fbe2acbbeef3036aa0d5e64f6b39b30d83cd80e7
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-05-16  Jer Noble  <jer.noble@apple.com>
2
3         CRASH: Exception thrown from -[AVContentKeySession processContentKeyRequestWithIdentifier:initializationData:options:] after -expire called
4         https://bugs.webkit.org/show_bug.cgi?id=185690
5         <rdar://problem/38297768>
6
7         Reviewed by Eric Carlson.
8
9         Reject all calls to update() after close() has been called on the session.
10
11         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
12         (WebCore::CDMSessionAVContentKeySession::update):
13
14 2018-05-16  Andy VanWagoner  <andy@vanwagoner.family>
15
16         Add support for Intl NumberFormat formatToParts
17         https://bugs.webkit.org/show_bug.cgi?id=185375
18
19         Reviewed by Yusuke Suzuki.
20
21         Test: js/intl-numberformat-format-to-parts.html
22
23         Add flag & tests for NumberFormat formatToParts.
24
25         * Configurations/FeatureDefines.xcconfig:
26
27 2018-05-16  Eric Carlson  <eric.carlson@apple.com>
28
29         Improve NowPlaying "title"
30         https://bugs.webkit.org/show_bug.cgi?id=185680
31         <rdar://problem/40296700>
32
33         Reviewed by Jer Noble.
34         
35         We send NowPlaying the element's title attribute if not empty, else the element's current url.
36         Title should be preferred because it is the most specific, but we should use the document
37         title if non-empty next, and if falling back to the element's url use just the domain instead
38         of the full url because it isn't likely to be useful to the user given the small amount of
39         space control center uses to display the title. Further, don't use any title at all when
40         in private browsing mode.
41
42         Tests: http/tests/media/now-playing-info-private-browsing.html
43                http/tests/media/now-playing-info.html
44
45         * html/HTMLMediaElement.cpp:
46         (WebCore::HTMLMediaElement::parseAttribute): Update NowPlaying when the title attribute changes.
47         (WebCore::HTMLMediaElement::finishSeek): Update NowPlaying when a seek completes.
48         (WebCore::HTMLMediaElement::mediaSessionTitle const): Update logic.
49         (WebCore::HTMLMediaElement::mediaSessionUniqueIdentifier const): Use the hash of the current 
50         url as the unique identifier.
51         * html/HTMLMediaElement.h:
52
53         * platform/audio/PlatformMediaSession.cpp:
54         (WebCore::PlatformMediaSession::uniqueIdentifier const): New.
55         (WebCore::PlatformMediaSessionClient::mediaSessionUniqueIdentifier const): Ditto.
56         * platform/audio/PlatformMediaSession.h:
57
58         * platform/audio/ios/MediaSessionManagerIOS.mm:
59         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Update m_lastUpdatedNowPlayingInfoUniqueIdentifier.
60
61         * platform/audio/mac/MediaSessionManagerMac.mm:
62         (WebCore::MediaSessionManagerMac::updateNowPlayingInfo): Update.
63
64         * testing/Internals.cpp:
65         (WebCore::Internals::nowPlayingState const): Expose NowPlaying state.
66         * testing/Internals.h:
67         * testing/Internals.idl:
68
69 2018-05-16  Daniel Bates  <dabates@apple.com>
70
71         Attempt to fix the WinCairo build following r231859
72         (https://bugs.webkit.org/show_bug.cgi?id=185654)
73
74         Instantiate Cookie as a struct and set applicable fields.
75
76         * platform/network/curl/CookieJarDB.cpp:
77         (WebCore::CookieJarDB::searchCookies):
78
79 2018-05-16  Daniel Bates  <dabates@apple.com>
80
81         Cleanup platform Cookie
82         https://bugs.webkit.org/show_bug.cgi?id=185654
83
84         Reviewed by Per Arne Vollan.
85
86         Remove unnecessary constructor and use =default for default constructor.
87         Simplify Cookie::decode() by having it decode directly into a stack-allocated
88         cookie. Remove some unnecessary local variables. Fix style nits.
89
90         * platform/Cookie.h:
91         (WebCore::Cookie::Cookie):
92         (WebCore::Cookie::isNull const):
93         (WebCore::Cookie::encode const):
94         (WebCore::Cookie::decode):
95         * platform/network/cf/CookieJarCFNet.cpp:
96         (WebCore::getRawCookies):
97         * platform/network/cocoa/CookieCocoa.mm:
98         (WebCore::cookieCreated):
99         (WebCore::Cookie::Cookie):
100         (WebCore::Cookie::operator== const):
101         (WebCore::Cookie::hash const):
102         * platform/network/soup/CookieJarSoup.cpp:
103         (WebCore::getRawCookies):
104
105 2018-05-14  Yusuke Suzuki  <utatane.tea@gmail.com>
106
107         [Win] Use C++17 in MSVC
108         https://bugs.webkit.org/show_bug.cgi?id=185232
109
110         Reviewed by Alex Christensen.
111
112         Workaround for MSVC + /std:c++17.
113
114         * Modules/geolocation/Coordinates.h:
115         (WebCore::Coordinates::isolatedCopy const):
116
117 2018-05-16  Chris Nardi  <cnardi@chromium.org>
118
119         Remove Document#selectedStylesheetSet/preferredStylesheetSet
120         https://bugs.webkit.org/show_bug.cgi?id=185381
121
122         Reviewed by Darin Adler.
123
124         Document#selectedStylesheetSet/preferredStylesheetSet are non-standard methods that
125         are only implemented WebKit. Blink removed these methods in https://crbug.com/690609.
126         The standard versions of these methods are are no longer in the spec. Remove them
127         entirely from our implementation.
128
129         Updated existing tests and imported/w3c/web-platform-tests/cssom/historical.html.
130
131         * dom/Document.cpp:
132         (WebCore::Document::processHttpEquiv):
133         * dom/Document.h:
134         * dom/Document.idl:
135         * style/StyleScope.cpp:
136         (WebCore::Style::Scope::collectActiveStyleSheets):
137         * style/StyleScope.h:
138         (WebCore::Style::Scope::preferredStylesheetSetName const):
139
140 2018-05-16  Zalan Bujtas  <zalan@apple.com>
141
142         [LFC] Implement width computation for replaced inflow elements.
143         https://bugs.webkit.org/show_bug.cgi?id=185672
144
145         Reviewed by Antti Koivisto.
146
147         Replaced width for block, inline and float elements compute the same way. 
148
149         * layout/FormattingContext.cpp:
150         (WebCore::Layout::FormattingContext::computeWidth const):
151         (WebCore::Layout::FormattingContext::computeFloatingWidth const):
152         (WebCore::Layout::FormattingContext::computeInFlowReplacedWidth const):
153         * layout/FormattingContext.h:
154         * layout/blockformatting/BlockFormattingContext.cpp:
155         (WebCore::Layout::BlockFormattingContext::computeInFlowWidth const):
156         * layout/layouttree/LayoutBox.cpp:
157         (WebCore::Layout::Box::hasIntrinsicWidth const):
158         (WebCore::Layout::Box::hasIntrinsicHeight const):
159         (WebCore::Layout::Box::hasIntrinsicRatio const):
160         (WebCore::Layout::Box::intrinsicWidth const):
161         (WebCore::Layout::Box::intrinsicHeight const):
162         (WebCore::Layout::Box::intrinsicRatio const):
163         * layout/layouttree/LayoutBox.h:
164
165 2018-05-16  Zalan Bujtas  <zalan@apple.com>
166
167         [LFC] Make Display::Box box sizing aware
168         https://bugs.webkit.org/show_bug.cgi?id=185649
169
170         Reviewed by Antti Koivisto.
171
172         Display::Box::width() == Display::Box::contentBox().width() <= box-sizing: content-box; (initial and default value)
173         Display::Box::width() == Display::Box::borderBox().width() <= box-sizing: border-box;
174
175         * layout/LayoutContext.cpp:
176         (WebCore::Layout::LayoutContext::createDisplayBox):
177         * layout/displaytree/DisplayBox.cpp:
178         (WebCore::Display::Box::Box):
179         (WebCore::Display::Box::marginBox const):
180         (WebCore::Display::Box::borderBox const):
181         (WebCore::Display::Box::paddingBox const):
182         (WebCore::Display::Box::contentBox const):
183         * layout/displaytree/DisplayBox.h:
184
185 2018-05-16  Antoine Quint  <graouts@apple.com>
186
187         REGRESSION (r230574): Interrupted hardware transitions don't behave correctly
188         https://bugs.webkit.org/show_bug.cgi?id=185299
189         <rdar://problem/39630230>
190
191         Reviewed by Simon Fraser.
192
193         In r230574, the fix for webkit.org/b/184518, we changed the processing order in GraphicsLayerCA::updateAnimations() to first
194         process m_uncomittedAnimations and then m_animationsToProcess, so we are guaranteed animations exist before we attempt to pause
195         or seek them. This broke interrupting and resuming hardware animations (such as an interrupted CSS Transition or an animation
196         running in a non-visible tab) since a pause operation recorded _before_ an animation was added would be paused anyway since
197         the animation was now first added, and then paused. The fix is simply to clear any pending AnimationProcessingAction for a
198         newly-uncommitted animation.
199
200         Test: transitions/interrupted-transition-hardware.html
201
202         * platform/graphics/ca/GraphicsLayerCA.cpp:
203         (WebCore::GraphicsLayerCA::createAnimationFromKeyframes):
204         (WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
205         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
206         * platform/graphics/ca/GraphicsLayerCA.h:
207         (WebCore::GraphicsLayerCA::LayerPropertyAnimation::LayerPropertyAnimation):
208
209 2018-05-15  Yusuke Suzuki  <utatane.tea@gmail.com>
210
211         [JSC] Check TypeInfo first before calling getCallData when we would like to check whether given object is a function
212         https://bugs.webkit.org/show_bug.cgi?id=185601
213
214         Reviewed by Saam Barati.
215
216         No behavior change.
217
218         * Modules/plugins/QuickTimePluginReplacement.mm:
219         (WebCore::QuickTimePluginReplacement::ensureReplacementScriptInjected):
220         * bindings/js/JSCustomElementRegistryCustom.cpp:
221         (WebCore::getCustomElementCallback):
222         * bindings/js/JSDOMConstructorBase.h:
223         * bindings/js/JSDOMConvertCallbacks.h:
224         (WebCore::Converter<IDLCallbackFunction<T>>::convert):
225         * bindings/js/JSDOMPromise.cpp:
226         (WebCore::DOMPromise::whenSettled):
227         * bindings/js/ReadableStream.cpp:
228         (WebCore::ReadableStream::pipeTo):
229         (WebCore::ReadableStream::tee):
230         * bindings/js/ReadableStreamDefaultController.cpp:
231         (WebCore::ReadableStreamDefaultController::invoke):
232         * bindings/scripts/CodeGeneratorJS.pm:
233         (GenerateHeader):
234         (GenerateOverloadDispatcher):
235         * bindings/scripts/test/JS/JSTestObj.h:
236         * bindings/scripts/test/JS/JSTestPluginInterface.h:
237         * bridge/objc/objc_runtime.h:
238         * bridge/runtime_method.h:
239         * bridge/runtime_object.h:
240         * html/HTMLMediaElement.cpp:
241         (WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
242         * testing/Internals.cpp:
243         (WebCore::Internals::parserMetaData):
244         (WebCore::Internals::cloneArrayBuffer):
245
246 2018-05-15  Matt Baker  <mattbaker@apple.com>
247
248         Web Inspector: element details hanger in inspector overlay should have better placement logic
249         https://bugs.webkit.org/show_bug.cgi?id=128482
250         <rdar://problem/16020709>
251
252         Reviewed by Timothy Hatcher.
253
254         When determining the best position for the hovered element details "tooltip",
255         perform placement tests in view space, not canvas space, and account for the
256         top content inset.
257
258         * inspector/InspectorOverlayPage.js:
259         (reset): Drive by fix: added missing `.height`.
260         (_drawElementTitle):
261
262 2018-05-15  Commit Queue  <commit-queue@webkit.org>
263
264         Unreviewed, rolling out r231765.
265         https://bugs.webkit.org/show_bug.cgi?id=185668
266
267         the layout test added with this change is very flaky
268         (Requested by realdawei on #webkit).
269
270         Reverted changeset:
271
272         "REGRESSION (r230574): Interrupted hardware transitions don't
273         behave correctly"
274         https://bugs.webkit.org/show_bug.cgi?id=185299
275         https://trac.webkit.org/changeset/231765
276
277 2018-05-15  Devin Rousso  <webkit@devinrousso.com>
278
279         Web Inspector: Add rulers and guides
280         https://bugs.webkit.org/show_bug.cgi?id=32263
281         <rdar://problem/19281564>
282
283         Reviewed by Matt Baker.
284
285         This patch is purely a visual change for WebInspector, and doesn't affect anything else.
286
287         * inspector/InspectorOverlay.h:
288         * inspector/InspectorOverlay.cpp:
289         (WebCore::InspectorOverlay::update):
290         (WebCore::InspectorOverlay::reset):
291         (WebCore::InspectorOverlay::drawGutter): Deleted.
292
293         * inspector/InspectorOverlayPage.html:
294         * inspector/InspectorOverlayPage.js:
295         (Bounds): Added.
296         (Bounds.prototype.get minX): Added.
297         (Bounds.prototype.get minY): Added.
298         (Bounds.prototype.get maxX): Added.
299         (Bounds.prototype.get maxY): Added.
300         (Bounds.prototype.update): Added.
301         (drawNodeHighlight):
302         (drawQuadHighlight):
303         (reset):
304         (_isolateActions): Added.
305         (_quadToPath): Added.
306         (_quadToPath.parseQuadPoint): Added.
307         (_drawOutlinedQuad): Added.
308         (_drawPath): Added.
309         (_drawPath.parsePoints): Added.
310         (_drawOutlinedQuadWithClip): Added.
311         (_drawElementTitle):
312         (_drawShapeHighlight):
313         (_drawFragmentHighlight):
314         (_drawRulers): Added.
315         (quadToPath): Deleted.
316         (drawOutlinedQuad): Deleted.
317         (pathCommand): Deleted.
318         (drawPath): Deleted.
319         (drawOutlinedQuadWithClip): Deleted.
320         (drawGutter): Deleted.
321         * inspector/InspectorOverlayPage.css:
322         (#log): Added.
323         (#right-gutter): Deleted.
324         (#bottom-gutter): Deleted.
325
326 2018-05-15  Jer Noble  <jer.noble@apple.com>
327
328         Media continues loading after rendered invisible (removed from DOM; scrolled off screen)
329         https://bugs.webkit.org/show_bug.cgi?id=185487
330
331         Reviewed by Eric Carlson.
332
333         Test: media/video-buffering-allowed.html
334
335         When a media element is removed from the dom (e.g. through innerHTML=""), it doesn't
336         necessarily stop loading media data; it will continue to do so until its destructor is
337         called through garbage collection. Similarly, when a media element is rendered not-visible
338         by being scrolled off-screen or being made display:none, media loading continues. There
339         are legitimate use cases for out-of-DOM media loading, so only temporarily block loading
340         when the element transitions out of the document. Similarly, only block loading for non-visible
341         media elements when returning from the "page is hidden" state, and only until the media
342         element is asked to play or is otherwise made visible.
343
344         Note: this refactors a lot of code out of PlatformMediaSession and into MediaElementSession,
345         since this code is specific to "media elements".
346
347         * html/HTMLMediaElement.cpp:
348         (WebCore::HTMLMediaElement::HTMLMediaElement):
349         (WebCore::HTMLMediaElement::insertedIntoAncestor):
350         (WebCore::HTMLMediaElement::removedFromAncestor):
351         (WebCore::HTMLMediaElement::playInternal):
352         (WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer):
353         (WebCore::HTMLMediaElement::resume):
354         (WebCore::HTMLMediaElement::visibilityStateChanged):
355         (WebCore::HTMLMediaElement::createMediaPlayer):
356         (WebCore::HTMLMediaElement::setShouldBufferData):
357         (WebCore::HTMLMediaElement::purgeBufferedDataIfPossible):
358         (WebCore::HTMLMediaElement::isVisibleInViewportChanged):
359         (WebCore::HTMLMediaElement::fullscreenModeChanged):
360         (WebCore::HTMLMediaElement::setInActiveDocument):
361         * html/HTMLMediaElement.h:
362         (WebCore::HTMLMediaElement::shouldBufferData const):
363         (WebCore::HTMLMediaElement::elementIsHidden const):
364         * html/MediaElementSession.cpp:
365         (WebCore::MediaElementSession::MediaElementSession):
366         (WebCore::MediaElementSession::clientWillBeginAutoplaying):
367         (WebCore::MediaElementSession::clientWillBeginPlayback):
368         (WebCore::MediaElementSession::clientWillPausePlayback):
369         (WebCore::MediaElementSession::visibilityChanged):
370         (WebCore::MediaElementSession::isVisibleInViewportChanged):
371         (WebCore::MediaElementSession::inActiveDocumentChanged):
372         (WebCore::MediaElementSession::scheduleClientDataBufferingCheck):
373         (WebCore::MediaElementSession::clientDataBufferingTimerFired):
374         (WebCore::MediaElementSession::updateClientDataBuffering):
375         (WebCore::MediaElementSession::dataBufferingPermitted const):
376         (WebCore::MediaElementSession::wantsToObserveViewportVisibilityForAutoplay const):
377         * html/MediaElementSession.h:
378         * platform/audio/PlatformMediaSession.cpp:
379         (WebCore::PlatformMediaSession::PlatformMediaSession):
380         (WebCore::PlatformMediaSession::clientWillBeginAutoplaying):
381         (WebCore::PlatformMediaSession::clientWillBeginPlayback):
382         (WebCore::PlatformMediaSession::clientWillPausePlayback):
383         (): Deleted.
384         (WebCore::PlatformMediaSession::visibilityChanged): Deleted.
385         (WebCore::PlatformMediaSession::scheduleClientDataBufferingCheck): Deleted.
386         (WebCore::PlatformMediaSession::clientDataBufferingTimerFired): Deleted.
387         (WebCore::PlatformMediaSession::updateClientDataBuffering): Deleted.
388         (WebCore::PlatformMediaSession::isHidden const): Deleted.
389         * platform/audio/PlatformMediaSession.h:
390         (WebCore::PlatformMediaSessionClient::setShouldBufferData): Deleted.
391         (WebCore::PlatformMediaSessionClient::elementIsHidden const): Deleted.
392         * platform/audio/PlatformMediaSessionManager.cpp:
393         (WebCore::PlatformMediaSessionManager::sessionCanLoadMedia const): Deleted.
394         * platform/audio/PlatformMediaSessionManager.h:
395         * platform/audio/ios/MediaSessionManagerIOS.h:
396         * platform/audio/ios/MediaSessionManagerIOS.mm:
397         (WebCore::MediaSessionManageriOS::sessionCanLoadMedia const): Deleted.
398         * rendering/RenderVideo.cpp:
399         (WebCore::RenderVideo::willBeDestroyed):
400         * testing/Internals.cpp:
401         (WebCore::Internals::elementShouldBufferData):
402         * testing/Internals.h:
403         * testing/Internals.idl:
404
405 2018-05-15  Charles Vazac  <cvazac@gmail.com>
406
407         Add the PerformanceServerTiming Interface which makes Server-Timing header timing values available to JavaScript running in the browser.
408         https://bugs.webkit.org/show_bug.cgi?id=175569
409
410         Reviewed by Youenn Fablet.
411
412         Tests were imported from web-platform-tests: WebKit/LayoutTests/imported/w3c/web-platform-tests/server-timing/*
413
414         * Sources.txt: Added references to HeaderFieldTokenizer.cpp, ServerTiming.cpp, and ServerTimingParser.cpp.
415         * WebCore.xcodeproj/project.pbxproj: Added various files.
416         * loader/HeaderFieldTokenizer.cpp: Added.
417         (WebCore::HeaderFieldTokenizer::HeaderFieldTokenizer): Added class for tokenizing header values.
418         (WebCore::HeaderFieldTokenizer::consume): Added method to consume a specified character.
419         (WebCore::HeaderFieldTokenizer::consumeQuotedString): Added method to consume a quote-string.
420         (WebCore::HeaderFieldTokenizer::consumeToken): Added a method to consume a token.
421         (WebCore::HeaderFieldTokenizer::consumeTokenOrQuotedString): Added method to consume a quote-string or quote-string, depending on net character.
422         (WebCore::HeaderFieldTokenizer::skipSpaces): Added method to skip whitespace.
423         (WebCore::HeaderFieldTokenizer::consumeBeforeAnyCharMatch): Added method to advance the cursor up until any of a list of characters.
424         * loader/HeaderFieldTokenizer.h: Added.
425         * loader/HTTPHeaderField.cpp: Expose isTokenCharacter and isWhitespace.
426         * loader/HTTPHeaderField.h: Expose isTokenCharacter and isWhitespace.
427         * loader/PolicyChecker.cpp: Added #include so source compiled on my machine.
428         * loader/ResourceTiming.cpp:
429         (WebCore::ResourceTiming::ResourceTiming): Added call to initServerTiming to parse the header.
430         (WebCore::ResourceTiming::initServerTiming): Added method to parse the header.
431         (WebCore::ResourceTiming::populateServerTiming): Added method to populate the server timing entries on a PerformanceResourceTiming object.
432         (WebCore::ResourceTiming::isolatedCopy const): Added code to copy over the server timing entries.
433         * loader/ResourceTiming.h:
434         (WebCore::ResourceTiming::ResourceTiming): Accept collection of server timing entries in c'tor.
435         * loader/ServerTiming.cpp: Added.
436         (WebCore::ServerTiming::setParameter): Set named parameters, ignoring unrecognized or duplicates.
437         (WebCore::ServerTiming::isolatedCopy const): Return a new pointer to the object.
438         * loader/ServerTiming.h: Added.
439         (WebCore::ServerTiming::ServerTiming): Added struct for the data needed by a server timing entry.
440         (WebCore::ServerTiming::name const): Added name field of a server timing entry.
441         (WebCore::ServerTiming::duration const): Added duration field of a server timing entry.
442         (WebCore::ServerTiming::description const): Added description field of a server timing entry.
443         * loader/ServerTimingParser.cpp: Added.
444         (WebCore::ServerTimingParser::parseServerTiming): Parses the header generating a collection of server timing structs.
445         * loader/ServerTimingParser.h: Added.
446         * loader/WorkerThreadableLoader.h: Fix build.
447         * page/Performance.cpp:
448         (WebCore::Performance::addResourceTiming): Fixed a typo.
449         * page/PerformanceResourceTiming.cpp:
450         (WebCore::PerformanceResourceTiming::PerformanceResourceTiming): Given a ResourceTiming object, populate our collection of PerformanceServerTiming objects.
451         * page/PerformanceResourceTiming.h: Added serverTiming member and getter.
452         * page/PerformanceResourceTiming.idl: Added serverTiming member to interface.
453         * platform/network/HTTPHeaderNames.in: Added "Server-Timing" to the header enum.
454         * platform/network/ResourceResponseBase.cpp: Added "Server-Timing" to isSafeCrossOriginResponseHeader whitelist.
455
456 2018-05-15  Brady Eidson  <beidson@apple.com>
457
458         Fix crash after a Worker terminates but there are still IDB transactions the server is trying to open for it.
459         <rdar://problem/33744241> and https://bugs.webkit.org/show_bug.cgi?id=185653
460
461         Reviewed by Andy Estes.
462
463         Test: storage/indexeddb/modern/worker-transaction-open-after-worker-stop.html
464
465         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
466         (WebCore::IDBClient::IDBConnectionProxy::didStartTransaction): It's okay to not be able to find a pending TX
467           that the server has started. e.g. When it was a WebWorker that asked for the TX but it has since terminated.
468
469 2018-05-15  Thomas Klausner  <tk@giga.or.at>
470
471         Add missing header to fix build.
472         https://bugs.webkit.org/show_bug.cgi?id=185378
473
474         Reviewed by Michael Catanzaro.
475
476         * platform/network/soup/SoupNetworkSession.h:
477
478 2018-05-15  Carlos Alberto Lopez Perez  <clopez@igalia.com>
479
480         [WPE] Build failure with RPi userland drivers and gstreamer-gl
481         https://bugs.webkit.org/show_bug.cgi?id=185639
482
483         Reviewed by Philippe Normand.
484
485         When building for the RPi with userland drivers (dispmanx) override the
486         value of GST_GL_HAVE_GLSYNC to 1 to avoid that the gstreamer-gl headers
487         try to redefine the GLsync type that is already defined in libepoxy.
488
489         Defining __gl2_h_ is also needed to avoid other conflicting type
490         definitions that happen between libepoxy and RPi GLES2 userland
491         headers when the gstreamer-gl headers are included.
492
493         The issue doesn't happen with 1.14.0, so a check for that is added
494         as well.
495
496         No new tests, no behavior change. It is a build fix.
497
498         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
499
500 2018-05-15  Michael Catanzaro  <mcatanzaro@igalia.com>
501
502         Unreviewed, rolling out r230749
503
504         This did not work as desired.
505
506         * platform/UserAgentQuirks.cpp:
507         (WebCore::urlRequiresMacintoshPlatform):
508
509 2018-05-15  Dirk Schulze  <krit@webkit.org>
510
511         Add new SVGDOM SVGFEBLEND constants
512         https://bugs.webkit.org/show_bug.cgi?id=185581
513
514         Reviewed by Simon Fraser.
515
516         Provide new SVG DOM constants for the new blend modes added to feBlend.
517
518         https://drafts.fxtf.org/filter-effects-1/#InterfaceSVGFEBlendElement
519
520         * platform/graphics/GraphicsTypes.cpp:
521         (WebCore::blendModeName):
522         * platform/graphics/GraphicsTypes.h:
523         * svg/SVGFEBlendElement.h:
524         (WebCore::SVGPropertyTraits<BlendMode>::highestEnumValue):
525         (WebCore::SVGPropertyTraits<BlendMode>::toString):
526         * svg/SVGFEBlendElement.idl:
527
528 2018-05-15  Antoine Quint  <graouts@apple.com>
529
530         [Web Animations] Expose Web Animations CSS integration as an experimental feature
531         https://bugs.webkit.org/show_bug.cgi?id=185647
532
533         Reviewed by Dean Jackson.
534
535         Make the Web Animations CSS integration flag an experimental feature, and only indicate that it is on if the Web Animations
536         experimental feature is also enabled.
537
538         * dom/Document.cpp:
539         (WebCore::Document::didBecomeCurrentDocumentInFrame):
540         (WebCore::Document::resume):
541         * dom/Element.cpp:
542         (WebCore::Element::removedFromAncestor):
543         * dom/PseudoElement.cpp:
544         (WebCore::PseudoElement::clearHostElement):
545         * history/CachedFrame.cpp:
546         (WebCore::CachedFrameBase::restore):
547         * page/Frame.cpp:
548         (WebCore::Frame::clearTimers):
549         * page/FrameView.cpp:
550         (WebCore::FrameView::didDestroyRenderTree):
551         * page/Page.cpp:
552         (WebCore::Page::handleLowModePowerChange):
553         (WebCore::Page::setIsVisibleInternal):
554         (WebCore::Page::hiddenPageCSSAnimationSuspensionStateChanged):
555         * page/RuntimeEnabledFeatures.h:
556         (WebCore::RuntimeEnabledFeatures::setWebAnimationsCSSIntegrationEnabled):
557         (WebCore::RuntimeEnabledFeatures::webAnimationsCSSIntegrationEnabled const):
558         (WebCore::RuntimeEnabledFeatures::setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled): Deleted.
559         (WebCore::RuntimeEnabledFeatures::cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled const): Deleted.
560         * rendering/RenderLayer.cpp:
561         (WebCore::RenderLayer::currentTransform const):
562         (WebCore::RenderLayer::calculateClipRects const):
563         * rendering/RenderLayerBacking.cpp:
564         (WebCore::RenderLayerBacking::updateGeometry):
565         * rendering/RenderLayerCompositor.cpp:
566         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation const):
567         (WebCore::RenderLayerCompositor::isRunningTransformAnimation const):
568         * rendering/updating/RenderTreeUpdater.cpp:
569         (WebCore::RenderTreeUpdater::tearDownRenderers):
570         * style/StyleTreeResolver.cpp:
571         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
572         * testing/InternalSettings.cpp:
573         (WebCore::InternalSettings::webAnimationsCSSIntegrationEnabled):
574         (WebCore::InternalSettings::cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled): Deleted.
575         * testing/InternalSettings.h:
576         * testing/InternalSettings.idl:
577         * testing/Internals.cpp:
578         (WebCore::Internals::numberOfActiveAnimations const):
579         (WebCore::Internals::animationsAreSuspended const):
580         (WebCore::Internals::animationsInterval const):
581         (WebCore::Internals::suspendAnimations const):
582         (WebCore::Internals::resumeAnimations const):
583
584 2018-05-15  David Kilzer  <ddkilzer@apple.com>
585
586         Fix -Wreturn-std-move warnings in WebKit found by new clang compiler
587         <https://webkit.org/b/185621>
588
589         Reviewed by Youenn Fablet.
590
591         Fix warnings like the following:
592
593             In file included from DerivedSources/WebCore/unified-sources/UnifiedSource139.cpp:5:
594             ./Modules/mediastream/PeerConnectionBackend.cpp:412:16: error: local variable 'sdp' will be copied despite being returned by name [-Werror,-Wreturn-std-move]
595                     return sdp;
596                            ^~~
597             ./Modules/mediastream/PeerConnectionBackend.cpp:412:16: note: call 'std::move' explicitly to avoid copying
598                     return sdp;
599                            ^~~
600                            std::move(sdp)
601             1 error generated.
602
603         * Modules/mediastream/PeerConnectionBackend.cpp:
604         (WebCore::PeerConnectionBackend::filterSDP const):
605         * accessibility/AccessibilityObject.cpp:
606         (WebCore::rangeClosestToRange):
607         * bindings/js/JSDOMConvertSequences.h:
608         (WebCore::Detail::GenericSequenceConverter::convert):
609         (WebCore::Detail::NumericSequenceConverter::convertArray):
610         * bindings/js/JSDOMConvertStrings.cpp:
611         (WebCore::stringToByteString):
612         (WebCore::stringToUSVString):
613         - Use WTFMove() in return statements to fix the warnings.
614
615 2018-05-14  Dean Jackson  <dino@apple.com>
616
617         Download and present System Preview
618         https://bugs.webkit.org/show_bug.cgi?id=185459
619         <rdar://problem/40079228>
620
621         Reviewed by Tim Horton.
622
623         If an <a> is a system preview, tell the resource request about it.
624
625         * html/HTMLAnchorElement.cpp:
626         (WebCore::HTMLAnchorElement::handleClick):
627
628 2018-05-15  Antti Koivisto  <antti@apple.com>
629
630         animation-play-state: paused causes very high cpu load because of style invalidation loop
631         https://bugs.webkit.org/show_bug.cgi?id=182436
632         <rdar://problem/37182562>
633
634         Reviewed by Dean Jackson.
635
636         Test: animations/animation-playstate-paused-style-resolution.html
637
638         If the style of an element with 'animation-play-state: paused' is recomputed so it stays
639         paused we would enter zero-duration animation timer loop.
640
641         * page/animation/AnimationBase.cpp:
642         (WebCore::AnimationBase::updateStateMachine):
643
644         Don't move to AnimationState::PausedWaitResponse unless we get AnimationStateInput::StyleAvailable
645         (matching the comments). Otherwise just stay in the existing paused state.
646
647         Remove AnimationStateInput::StartAnimation from assertion as the case can't happen.
648
649 2018-05-14  Youenn Fablet  <youenn@apple.com>
650
651         readableStreamDefaultControllerError should return early if stream is not readable
652         https://bugs.webkit.org/show_bug.cgi?id=185602
653
654         Reviewed by Chris Dumez.
655
656         Return early if stream is not readable in @readableStreamDefaultControllerError.
657         Update call sites to no longer check for ReadableStream state.
658         Covered by unflaked and rebased tests.
659
660         * Modules/streams/ReadableStreamDefaultController.js:
661         (error):
662         * Modules/streams/ReadableStreamInternals.js:
663         (readableStreamDefaultControllerError):
664         (readableStreamDefaultControllerCallPullIfNeeded):
665
666 2018-05-14  Zalan Bujtas  <zalan@apple.com>
667
668         [LFC] Implement width computation for non-replaced block level inflow elements.
669         https://bugs.webkit.org/show_bug.cgi?id=185641
670
671         Reviewed by Sam Weinig.
672
673         Block level inflow elements participate in block formatting context.
674
675         * layout/FormattingContext.cpp:
676         (WebCore::Layout::FormattingContext::computeWidth const):
677         * layout/FormattingContext.h:
678         * layout/blockformatting/BlockFormattingContext.cpp:
679         (WebCore::Layout::BlockFormattingContext::computeInFlowWidth const):
680         * layout/blockformatting/BlockFormattingContext.h:
681         * layout/inlineformatting/InlineFormattingContext.cpp:
682         (WebCore::Layout::InlineFormattingContext::computeInFlowWidth const):
683         * layout/inlineformatting/InlineFormattingContext.h:
684
685 2018-05-14  Wenson Hsieh  <wenson_hsieh@apple.com>
686
687         Unreviewed, fix the iOS build after r231779
688
689         Also address a minor in-person review comment by returning "extrazoom" instead of the empty string.
690
691         * page/DisabledAdaptations.cpp:
692         (WebCore::extraZoomModeAdaptationName):
693
694 2018-05-14  Zalan Bujtas  <zalan@apple.com>
695
696         [LFC] FormattingContext:computeOutOfFlowNonReplacedHeight/Width should use the computed margins/paddings/borders
697         https://bugs.webkit.org/show_bug.cgi?id=185633
698
699         Reviewed by Sam Weinig.
700
701         By the time we start computing height and width, DisplayBox should already have the computed values for margin/padding/border.
702
703         * layout/FormattingContext.cpp:
704         (WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedHeight const):
705         (WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedWidth const):
706         * layout/displaytree/DisplayBox.h:
707         (WebCore::Display::Box::paddingTop const):
708         (WebCore::Display::Box::paddingLeft const):
709         (WebCore::Display::Box::paddingBottom const):
710         (WebCore::Display::Box::paddingRight const):
711         (WebCore::Display::Box::borderTop const):
712         (WebCore::Display::Box::borderLeft const):
713         (WebCore::Display::Box::borderBottom const):
714         (WebCore::Display::Box::borderRight const):
715
716 2018-05-14  Wenson Hsieh  <wenson_hsieh@apple.com>
717
718         [Extra zoom mode] Google search results are excessively zoomed in
719         https://bugs.webkit.org/show_bug.cgi?id=185347
720         <rdar://problem/39999778>
721
722         Reviewed by Tim Horton.
723
724         It turns out that basing minimum layout size and shrink-to-fit behaviors off of the `shrink-to-fit` viewport
725         argument poses compatibility risks with web pages that already specify `shrink-to-fit` to opt out of default
726         viewport shrinking behaviors in 1/3 multitasking mode on iPad.
727
728         One way to resolve this is to introduce a new viewport meta content attribute to disable viewport heuristics in
729         extra zoom mode. However, combined shrink-to-fit and minimum device width behaviors are difficult to describe
730         using a single backwards-compatible viewport meta content attribute, and the need to suppress the default
731         behavior of `shrink-to-fit=no` if such an attribute is not disabled further muddles our viewport story.
732
733         After some internal deliberation, we’ve decided to experiment with a new meta tag named "disabled-adaptations".
734         The content of this meta tag is a comma-separated list of adaptation names; if an adaptation name matches a
735         known adaptation type (for instance, extra zoom mode), we disable the class of behaviors used to adapt web
736         content. The first and only known adaptation type is extra zoom mode, which affects `shrink-to-fit` and layout
737         size adjustments.
738
739         See per-method changes below for more details.
740
741         Test: fast/viewport/extrazoom/viewport-disable-extra-zoom-adaptations.html
742
743         * Sources.txt:
744         * WebCore.xcodeproj/project.pbxproj:
745         * dom/Document.cpp:
746         (WebCore::Document::processDisabledAdaptations):
747         * dom/Document.h:
748         (WebCore::Document::disabledAdaptations const):
749
750         Add disabled adaptations to Document. Changes to disabled adaptations are not propagated if the parsed disabled
751         adaptation types don't change; upon changing adaptation types, notify the client to adjust for the new disabled
752         adaptations (currently, this only affects the viewport configuration).
753
754         * dom/ViewportArguments.h:
755         * html/HTMLMetaElement.cpp:
756         (WebCore::HTMLMetaElement::process):
757         * html/parser/HTMLPreloadScanner.cpp:
758         (WebCore::TokenPreloadScanner::StartTagScanner::StartTagScanner):
759         (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
760         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
761         * loader/FrameLoader.cpp:
762         (WebCore::FrameLoader::commitProvisionalLoad):
763
764         Restore the set of disabled adaptations when restoring a page from the cache.
765
766         * page/Chrome.cpp:
767         (WebCore::Chrome::dispatchDisabledAdaptationsDidChange const):
768         * page/Chrome.h:
769         * page/ChromeClient.h:
770
771         Add plumbing for changes to the set of disabled adaptations.
772
773         * page/DisabledAdaptations.cpp: Added.
774         (WebCore::extraZoomModeAdaptationName):
775         * page/DisabledAdaptations.h: Added.
776
777         Introduce a header containing a new enum for the extra zoom mode adaptation, as well as a helper function to
778         return the extra zoom mode adaptation name.
779
780         * page/Page.cpp:
781         (WebCore::Page::disabledAdaptations const):
782
783         Returns the mainframe's set of adaptations to disable.
784
785         * page/Page.h:
786         * page/RemoteFrame.h:
787         * page/RuntimeEnabledFeatures.h:
788         (WebCore::RuntimeEnabledFeatures::setDisabledAdaptationsMetaTagEnabled):
789         (WebCore::RuntimeEnabledFeatures::disabledAdaptationsMetaTagEnabled const):
790
791         Add a new runtime feature to gate handling the "disabled-adaptations" meta tag.
792
793         * page/ViewportConfiguration.cpp:
794         (WebCore::shouldOverrideShrinkToFitArgument):
795         (WebCore::needsUpdateAfterChangingDisabledAdaptations):
796         (WebCore::ViewportConfiguration::setDisabledAdaptations):
797         (WebCore::ViewportConfiguration::shouldOverrideDeviceWidthAndShrinkToFit const):
798
799         Consult whether or not extra zoom mode adaptations are disabled, instead of the shrink-to-fit attribute value.
800
801         (WebCore::ViewportConfiguration::updateConfiguration):
802         * page/ViewportConfiguration.h:
803
804         Add an OptionSet of disabled adaptation types to ViewportConfiguration. Updates to the adaptation type are
805         propagated to the ViewportConfiguration from Document, through the ChromeClient and the client layer (refer to
806         changes in WebKit). Once the OptionSet is changed, we recompute the viewport configuration only if needed by the
807         platform.
808
809         (WebCore::ViewportConfiguration::viewLayoutSize const):
810         (WebCore::ViewportConfiguration::disabledAdaptations const):
811         * page/WindowFeatures.cpp:
812         (WebCore::parseDisabledAdaptations):
813         * page/WindowFeatures.h:
814
815         Add a new helper to parse the meta content of a "disabled-adaptations" tag as an OptionSet of disabled
816         adaptation types. The string is parsed by first splitting on the comma character, and then iterating over lower
817         case, whitespace-stripped tokens to look for known adaptation names. So far, only extra zoom mode is supported.
818
819         * testing/Internals.cpp:
820         (WebCore::Internals::extraZoomModeAdaptationName const):
821         * testing/Internals.h:
822         * testing/Internals.idl:
823
824         Expose the extra zoom mode adaptation name to the DOM, only when running layout tests.
825
826 2018-05-14  Joanmarie Diggs  <jdiggs@igalia.com>
827
828         AX: Listbox and Combobox roles embedded in labels should participate in name calculation
829         https://bugs.webkit.org/show_bug.cgi?id=185521
830
831         Reviewed by Chris Fleizach.
832
833         Take selected children into account when computing the name in accessibleNameForNode.
834         Add ListBox to the roles for which accessibleNameDerivesFromContent returns false so
835         that native select elements with size > 1 are treated the same way as ARIA listbox.
836         Also add ListBox to the roles which are treated as controls when used in ARIA. Finally,
837         prevent labels which contain unrelated controls from being used as an AXTitleUIElement.
838         This causes us to build a string from the label and its descendants, ensuring the latter
839         participate in the name calculation.
840
841         Test: accessibility/text-alternative-calculation-from-listbox.html
842
843         * accessibility/AccessibilityLabel.cpp:
844         (WebCore::childrenContainUnrelatedControls):
845         (WebCore::AccessibilityLabel::containsUnrelatedControls const):
846         * accessibility/AccessibilityLabel.h:
847         * accessibility/AccessibilityNodeObject.cpp:
848         (WebCore::accessibleNameForNode):
849         * accessibility/AccessibilityObject.cpp:
850         (WebCore::AccessibilityObject::accessibleNameDerivesFromContent const):
851         (WebCore::AccessibilityObject::isARIAControl):
852         * accessibility/AccessibilityRenderObject.cpp:
853         (WebCore::AccessibilityRenderObject::exposesTitleUIElement const):
854         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const):
855
856 2018-05-14  Antoine Quint  <graouts@apple.com>
857
858         [Web Animations] Tests using the new animation engine may crash under WebCore::FrameView::didDestroyRenderTree when using internals methods
859         https://bugs.webkit.org/show_bug.cgi?id=185612
860         <rdar://problem/39579344>
861
862         Reviewed by Dean Jackson.
863
864         Add a new internals.pseudoElement() method to obtain a pseudo element matching a given pseudo-id. This is necessary to be able to move off
865         internals.pauseTransitionAtTimeOnPseudoElement() and internals.pauseAnimationAtTimeOnPseudoElement() for Web Animations testing.
866
867         * testing/Internals.cpp:
868         (WebCore::Internals::pseudoElement):
869         * testing/Internals.h:
870         * testing/Internals.idl:
871
872 2018-05-14  Antoine Quint  <graouts@apple.com>
873
874         REGRESSION (r230574): Interrupted hardware transitions don't behave correctly
875         https://bugs.webkit.org/show_bug.cgi?id=185299
876         <rdar://problem/39630230>
877
878         Reviewed by Simon Fraser.
879
880         In r230574, the fix for webkit.org/b/184518, we changed the processing order in GraphicsLayerCA::updateAnimations() to first
881         process m_uncomittedAnimations and then m_animationsToProcess, so we are guaranteed animations exist before we attempt to pause
882         or seek them. This broke interrupting and resuming hardware animations (such as an interrupted CSS Transition or an animation
883         running in a non-visible tab) since a pause operation recorded _before_ an animation was added would be paused anyway since
884         the animation was now first added, and then paused. The fix is simply to clear any pending AnimationProcessingAction for a
885         newly-uncommitted animation.
886
887         Test: transitions/interrupted-transition-hardware.html
888
889         * platform/graphics/ca/GraphicsLayerCA.cpp:
890         (WebCore::GraphicsLayerCA::createAnimationFromKeyframes):
891         (WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
892         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
893         * platform/graphics/ca/GraphicsLayerCA.h:
894         (WebCore::GraphicsLayerCA::LayerPropertyAnimation::LayerPropertyAnimation):
895
896 2018-05-14  Thibault Saunier  <tsaunier@igalia.com>
897
898         [GStreamer] Fix style issue in MediaPlayerPrivateGStreamerBase
899         https://bugs.webkit.org/show_bug.cgi?id=185510
900
901         Reviewed by Philippe Normand.
902
903         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:629:  More than one command on the same line  [whitespace/newline] [4]
904         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:684:  More than one command on the same line  [whitespace/newline] [4]
905         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:807:  More than one command on the same line  [whitespace/newline] [4]
906
907         Indentation and style issue fixed only.
908
909         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
910         (WebCore::MediaPlayerPrivateGStreamerBase::volumeChangedCallback):
911         (WebCore::MediaPlayerPrivateGStreamerBase::muteChangedCallback):
912         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
913
914 2018-05-14  Zalan Bujtas  <zalan@apple.com>
915
916         [LFC] Implement height computation for non-replaced out of flow elements.
917         https://bugs.webkit.org/show_bug.cgi?id=185585
918
919         Reviewed by Antti Koivisto.
920
921         * layout/FormattingContext.cpp:
922         (WebCore::Layout::FormattingContext::computeHeight const):
923         (WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
924         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
925         (WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedHeight const):
926         (WebCore::Layout::FormattingContext::computeHeightForBlockFormattingContextRootWithAutoHeight const):
927         * layout/FormattingContext.h:
928         * layout/blockformatting/BlockFormattingContext.h:
929         * layout/displaytree/DisplayBox.h:
930
931 2018-05-14  Manuel Rego Casasnovas  <rego@igalia.com>
932
933         Renaming of overrides in LayoutBox
934         https://bugs.webkit.org/show_bug.cgi?id=185609
935
936         Reviewed by Javier Fernandez.
937
938         The names of the methods for the overrides were not consistent,
939         this patch fixes it by using the same structure in all the cases.
940
941         No new tests, no change of behavior.
942
943         * rendering/GridLayoutFunctions.cpp:
944         (WebCore::GridLayoutFunctions::hasOverrideContainingBlockContentSizeForChild):
945         * rendering/GridTrackSizingAlgorithm.cpp:
946         (WebCore::GridTrackSizingAlgorithmStrategy::logicalHeightForChild const):
947         * rendering/RenderBlock.cpp:
948         (WebCore::RenderBlock::computeChildPreferredLogicalWidths const):
949         (WebCore::RenderBlock::availableLogicalHeightForPercentageComputation const):
950         * rendering/RenderBlockFlow.cpp:
951         (WebCore::RenderBlockFlow::fitBorderToLinesIfNeeded):
952         * rendering/RenderBlockLineLayout.cpp:
953         (WebCore::RenderBlockFlow::updateRubyForJustifiedText):
954         * rendering/RenderBox.cpp:
955         (WebCore::RenderBox::willBeDestroyed):
956         (WebCore::RenderBox::hasOverrideContentLogicalHeight const):
957         (WebCore::RenderBox::hasOverrideContentLogicalWidth const):
958         (WebCore::RenderBox::setOverrideContentLogicalHeight):
959         (WebCore::RenderBox::setOverrideContentLogicalWidth):
960         (WebCore::RenderBox::clearOverrideContentLogicalHeight):
961         (WebCore::RenderBox::clearOverrideContentLogicalWidth):
962         (WebCore::RenderBox::clearOverrideContentSize):
963         (WebCore::RenderBox::overrideContentLogicalWidth const):
964         (WebCore::RenderBox::overrideContentLogicalHeight const):
965         (WebCore::RenderBox::overrideContainingBlockContentLogicalWidth const):
966         (WebCore::RenderBox::overrideContainingBlockContentLogicalHeight const):
967         (WebCore::RenderBox::hasOverrideContainingBlockContentLogicalWidth const):
968         (WebCore::RenderBox::hasOverrideContainingBlockContentLogicalHeight const):
969         (WebCore::RenderBox::setOverrideContainingBlockContentLogicalWidth):
970         (WebCore::RenderBox::setOverrideContainingBlockContentLogicalHeight):
971         (WebCore::RenderBox::clearOverrideContainingBlockContentSize):
972         (WebCore::RenderBox::clearOverrideContainingBlockContentLogicalHeight):
973         (WebCore::RenderBox::containingBlockLogicalWidthForContent const):
974         (WebCore::RenderBox::containingBlockLogicalHeightForContent const):
975         (WebCore::RenderBox::perpendicularContainingBlockLogicalHeight const):
976         (WebCore::RenderBox::computeLogicalWidthInFragment const):
977         (WebCore::RenderBox::computeLogicalHeight const):
978         (WebCore::RenderBox::computePercentageLogicalHeight const):
979         (WebCore::RenderBox::computeReplacedLogicalHeightUsing const):
980         (WebCore::RenderBox::availableLogicalHeightUsing const):
981         (WebCore::RenderBox::containingBlockLogicalWidthForPositioned const):
982         (WebCore::RenderBox::containingBlockLogicalHeightForPositioned const):
983         * rendering/RenderBox.h:
984         * rendering/RenderBoxModelObject.cpp:
985         (WebCore::RenderBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight const):
986         * rendering/RenderDeprecatedFlexibleBox.cpp:
987         (WebCore::contentWidthForChild):
988         (WebCore::contentHeightForChild):
989         (WebCore::gatherFlexChildrenInfo):
990         (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
991         (WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox):
992         (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
993         (WebCore::RenderDeprecatedFlexibleBox::clearLineClamp):
994         * rendering/RenderFlexibleBox.cpp:
995         (WebCore::RenderFlexibleBox::computeInnerFlexBaseSizeForChild):
996         (WebCore::RenderFlexibleBox::crossSizeForPercentageResolution):
997         (WebCore::RenderFlexibleBox::mainSizeForPercentageResolution):
998         (WebCore::RenderFlexibleBox::constructFlexItem):
999         (WebCore::RenderFlexibleBox::setOverrideMainAxisContentSizeForChild):
1000         (WebCore::RenderFlexibleBox::applyStretchAlignmentToChild):
1001         * rendering/RenderFullScreen.cpp:
1002         (WebCore::RenderFullScreen::unwrapRenderer):
1003         * rendering/RenderGrid.cpp:
1004         (WebCore::RenderGrid::layoutBlock):
1005         (WebCore::RenderGrid::layoutGridItems):
1006         (WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded):
1007         * rendering/RenderRubyBase.cpp:
1008         (WebCore::RenderRubyBase::adjustInlineDirectionLineBounds const):
1009         * rendering/RenderTableCell.cpp:
1010         (WebCore::RenderTableCell::setOverrideContentLogicalHeightFromRowHeight):
1011         * rendering/RenderTableCell.h:
1012         * rendering/RenderTableSection.cpp:
1013         (WebCore::RenderTableSection::calcRowLogicalHeight):
1014         (WebCore::RenderTableSection::relayoutCellIfFlexed):
1015
1016 2018-05-14  Zalan Bujtas  <zalan@apple.com>
1017
1018         [LFC] Implement width computation for non-replaced out of flow elements.
1019         https://bugs.webkit.org/show_bug.cgi?id=185598
1020
1021         Reviewed by Antti Koivisto.
1022
1023         * layout/FormattingContext.cpp:
1024         (WebCore::Layout::FormattingContext::computeWidth const):
1025         (WebCore::Layout::FormattingContext::computeOutOfFlowWidth const):
1026         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
1027         (WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedWidth const):
1028         (WebCore::Layout::FormattingContext::shrinkToFitWidth const):
1029         * layout/FormattingContext.h:
1030         * layout/blockformatting/BlockFormattingContext.cpp:
1031         (WebCore::Layout::BlockFormattingContext::layout const):
1032         * layout/displaytree/DisplayBox.h:
1033
1034 2018-05-14  Zan Dobersek  <zdobersek@igalia.com>
1035
1036         Drop the m_compositorTexture member variable in TextureMapperGC3DPlatformLayer.
1037         It's not used at all inside the class or outside it.
1038
1039         Rubber-stamped by Michael Catanzaro.
1040
1041         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h:
1042
1043 2018-05-14  Zan Dobersek  <zdobersek@igalia.com>
1044
1045         [GTK] REGRESSION(r231170) Build broken with Clang 5.0
1046         https://bugs.webkit.org/show_bug.cgi?id=185198
1047
1048         Reviewed by Michael Catanzaro.
1049
1050         Avoid gperf files using the register keyword which has been made
1051         reserved and as such unusable in C++17.
1052
1053         * css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
1054         * css/makeSelectorPseudoElementsMap.py:
1055         * css/makeprop.pl:
1056         * css/makevalues.pl:
1057         * platform/ColorData.gperf:
1058         * platform/ReferrerPolicy.h: With std::optional forward declaration
1059         gone, explicitly include the WTF Optional.h header.
1060         * platform/Theme.h: Ditto.
1061         * platform/network/create-http-header-name-table:
1062
1063 2018-05-14  Commit Queue  <commit-queue@webkit.org>
1064
1065         Unreviewed, rolling out r219515.
1066         https://bugs.webkit.org/show_bug.cgi?id=185603
1067
1068         It sometimes makes AudioUnitInitialize call to fail in
1069         CoreAudioCaptureSource (Requested by youenn on #webkit).
1070
1071         Reverted changeset:
1072
1073         "Remove CoreAudioCaptureSource speaker configuration"
1074         https://bugs.webkit.org/show_bug.cgi?id=174512
1075         https://trac.webkit.org/changeset/219515
1076
1077 2018-05-13  Dirk Schulze  <krit@webkit.org>
1078
1079         Implement SVGGeometryElement's isPointInFill and isPointInStroke
1080         https://bugs.webkit.org/show_bug.cgi?id=185580
1081
1082         Reviewed by Antti Koivisto.
1083
1084         Implement isPointInFill and isPointInStroke methods for
1085         SVGGeometryElement interface from SVG2.
1086
1087         https://svgwg.org/svg2-draft/types.html#InterfaceSVGGeometryElement
1088
1089         Tests: svg/dom/SVGGeometry-isPointInFill.xhtml
1090                svg/dom/SVGGeometry-isPointInStroke.xhtml
1091
1092         * rendering/svg/RenderSVGEllipse.cpp:
1093         (WebCore::RenderSVGEllipse::shapeDependentStrokeContains): Flag
1094                 to switch between local and "global" coordinate space for hit testing.
1095         * rendering/svg/RenderSVGEllipse.h:
1096         * rendering/svg/RenderSVGPath.cpp:
1097         (WebCore::RenderSVGPath::shapeDependentStrokeContains): Flag
1098                 to switch between local and "global" coordinate space for hit testing.
1099         * rendering/svg/RenderSVGPath.h:
1100         * rendering/svg/RenderSVGRect.cpp:
1101         (WebCore::RenderSVGRect::shapeDependentStrokeContains): Flag
1102                 to switch between local and "global" coordinate space for hit testing.
1103         * rendering/svg/RenderSVGRect.h:
1104         * rendering/svg/RenderSVGShape.cpp:
1105         (WebCore::RenderSVGShape::shapeDependentStrokeContains): Flag
1106                 to switch between local and "global" coordinate space for hit testing.
1107         (WebCore::RenderSVGShape::isPointInFill): Take the winding rule given by
1108                 `fill-rule` to test if a given point is in the fill area of a path.
1109         (WebCore::RenderSVGShape::isPointInStroke): Take stroke properties into
1110                 account to check if a point is on top of the stroke area.
1111         * rendering/svg/RenderSVGShape.h:
1112         * svg/SVGGeometryElement.cpp:
1113         (WebCore::SVGGeometryElement::isPointInFill):
1114         (WebCore::SVGGeometryElement::isPointInStroke):
1115         (WebCore::SVGGeometryElement::createElementRenderer): Deleted. This is getting implemented
1116                 by inheriting classes. No need to create RenderSVGPath here.
1117         * svg/SVGGeometryElement.h:
1118         * svg/SVGGeometryElement.idl:
1119
1120 2018-05-12  Zalan Bujtas  <zalan@apple.com>
1121
1122         Use WeakPtr for m_enclosingPaginationLayer in RenderLayer
1123         https://bugs.webkit.org/show_bug.cgi?id=185566
1124         <rdar://problem/36486052>
1125
1126         Reviewed by Simon Fraser.
1127
1128         Since RenderLayer does not own the enclosing pagination layout, it should
1129         construct a weak pointer instead of holding on to a raw pointer.
1130
1131         Unable to create a reliably reproducible test case.
1132
1133         * page/mac/EventHandlerMac.mm:
1134         (WebCore::scrollableAreaForEventTarget):
1135         (WebCore::scrollableAreaForContainerNode):
1136         (WebCore::EventHandler::platformPrepareForWheelEvents):
1137         * platform/ScrollableArea.h:
1138         (WebCore::ScrollableArea::weakPtrFactory const):
1139         (WebCore::ScrollableArea::createWeakPtr): Deleted.
1140         * rendering/RenderLayer.cpp:
1141         (WebCore::RenderLayer::RenderLayer):
1142         (WebCore::RenderLayer::updatePagination):
1143         * rendering/RenderLayer.h:
1144
1145 2018-05-11  Daniel Bates  <dabates@apple.com>
1146
1147         X-Frame-Options: SAMEORIGIN needs to check all ancestor frames
1148         https://bugs.webkit.org/show_bug.cgi?id=185567
1149         <rdar://problem/40175008>
1150
1151         Reviewed by Brent Fulgham.
1152
1153         Change the behavior of "X-Frame-Options: SAMEORIGIN" to ensure that all ancestors frames
1154         are same-origin with the document that delivered this header. This prevents an intermediary
1155         malicious frame from clickjacking a child frame whose document is same-origin with the top-
1156         level frame. It also makes the behavior of X-Frame-Options in WebKit more closely match
1157         the behavior of X-Frame-Options in other browsers, including Chrome and Firefox.
1158         
1159         Currently a document delivered with "X-Frame-Options: SAMEORIGIN" must only be same-origin
1160         with the top-level frame's document in order to be displayed. This prevents clickjacking by
1161         a malicious page that embeds a page delivered with "X-Frame-Options: SAMEORIGIN". However,
1162         it does not protect against clickjacking of the "X-Frame-Options: SAMEORIGIN" page (victim)
1163         if embedded by an intermediate malicious iframe, say a "rogue ad", that was embedded in a
1164         document same origin with the victim page. We should protect against such attacks. 
1165
1166         Tests: http/tests/security/XFrameOptions/x-frame-options-ancestors-same-origin-allow.html
1167                http/tests/security/XFrameOptions/x-frame-options-ancestors-same-origin-deny.html
1168
1169         * loader/FrameLoader.cpp:
1170         (WebCore::FrameLoader::shouldInterruptLoadForXFrameOptions):
1171
1172 2018-05-11  Daniel Bates  <dabates@apple.com>
1173
1174         [iOS] Text decoration of dragged content does not paint with opacity
1175         https://bugs.webkit.org/show_bug.cgi?id=185551
1176         <rdar://problem/40166867>
1177
1178         Reviewed by Wenson Hsieh.
1179
1180         Respect alpha when painting the text decoration for dragged content.
1181
1182         * rendering/InlineTextBox.cpp:
1183         (WebCore::InlineTextBox::MarkedTextStyle::areDecorationMarkedTextStylesEqual): Consider alpha when
1184         comparing decoration styles for equality so that we do not coalesce styles with differing alpha.
1185         (WebCore::InlineTextBox::paintMarkedTextDecoration): Respect alpha when painting dragged content.
1186
1187 2018-05-11  Nan Wang  <n_wang@apple.com>
1188
1189         AX: In role=dialog elements with aria-modal=true VoiceOver iOS/macOS can't manually focus or read dialog paragraph description text inside the modal.
1190         https://bugs.webkit.org/show_bug.cgi?id=185219
1191         <rdar://problem/39920009>
1192
1193         Reviewed by Chris Fleizach.
1194
1195         The text node descendants of a modal dialog are ignored. Fixed it by using AccessibilityObject's 
1196         node() to determine if it's the descendant of the modal dialog node.
1197
1198         Test: accessibility/aria-modal-text-descendants.html
1199
1200         * accessibility/AccessibilityObject.cpp:
1201         (WebCore::AccessibilityObject::isModalDescendant const):
1202
1203 2018-05-11  Ryosuke Niwa  <rniwa@webkit.org>
1204
1205         Tapping after CSS-based table casues an infinite loop in wordRangeFromPosition
1206         https://bugs.webkit.org/show_bug.cgi?id=185465
1207         <rdar://problem/35263057>
1208
1209         Reviewed by Antti Koivisto.
1210
1211         The bug was caused by TextIterator not emitting a line break when exiting a CSS-based table when an element
1212         with `display: table-row` has an invisible text node. Specifically, TextIterator::exitNode is never called on
1213         an element with `table-cell: row` when m_node is a text node with whitespaces which appears after an element
1214         with `display: table-cell`.
1215
1216         For example, for a tree structure like:
1217         table-row (R)
1218           table-cell (C)
1219             "text" (1)
1220           " " (2)
1221         Getting out of (C) would result in moving onto (2) without generating a line break for (R).
1222
1223         When this happens in nextBoundary as it tries to find the end of the last word in the table cell, we end up
1224         finding the end of the document as the end of the word. As a result, nextWordBoundaryInDirection, the caller
1225         of nextBoundary, ends up infinite looping between the positon at the end of the document and the position
1226         immediately before the last word in the last table cell when it traverses words backwards.
1227
1228         This patch fixes the hang by addressing this root cause in TextIterator. Namely, TextIterator now generates
1229         a line break when exiting a block while walking up ancestors in TextIterator::advance().
1230
1231         Tests: editing/selection/tapping-in-table-at-end-of-document.html
1232                editing/text-iterator/table-at-end-of-document.html
1233
1234         * editing/TextIterator.cpp:
1235         (WebCore::TextIterator::advance): Fixed the bug.
1236         (WebCore::shouldEmitNewlineAfterNode): Do generate a new line at the end of a document when we're trying to
1237         generate every visible poitions even there are no renderers beyond this point. e.g. a position inside the
1238         last cell of a table at the end of a document hits this condition.
1239         (WebCore::shouldEmitExtraNewlineForNode): Don't emit a line break when the render box's height is 0px
1240         to avoid generating many empty lines for empty paragraph and header elements (this function is used to generate
1241         a blank line between p's and h1/h2/...'s).
1242         (WebCore::TextIterator::exitNode):
1243
1244 2018-05-11  Dean Jackson  <dino@apple.com>
1245
1246         System preview badge doesn't show on <picture> elements
1247         https://bugs.webkit.org/show_bug.cgi?id=185559
1248         <rdar://problem/40150066>
1249
1250         Reviewed by Tim Horton.
1251
1252         We should also identify <img>s that are the child of a <picture>
1253         contained inside the appropriate <a> element.
1254
1255         Tested internally, since the badge is platform specific.
1256
1257         * html/HTMLImageElement.cpp:
1258         (WebCore::HTMLImageElement::isSystemPreviewImage const): Add logic
1259         to look for <picture> parents.
1260
1261 2018-05-11  Chris Dumez  <cdumez@apple.com>
1262
1263         REGRESSION (async policy delegate): Revoking an object URL immediately after triggering download breaks file download
1264         https://bugs.webkit.org/show_bug.cgi?id=185531
1265         <rdar://problem/39909589>
1266
1267         Reviewed by Geoffrey Garen.
1268
1269         Whenever we start an asynchronous navigation policy decision for a blob URL, create a temporary
1270         blob URL pointing to the same data, and update the request's URL. This way, if the page's JS revokes
1271         the URL during the policy decision, the load will still succeed.
1272
1273         Test: fast/dom/HTMLAnchorElement/anchor-file-blob-download-then-revoke.html
1274
1275         * loader/DocumentLoader.cpp:
1276         (WebCore::DocumentLoader::willSendRequest):
1277         * loader/FrameLoader.cpp:
1278         (WebCore::FrameLoader::loadURL):
1279         (WebCore::FrameLoader::load):
1280         (WebCore::FrameLoader::loadPostRequest):
1281         * loader/PolicyChecker.cpp:
1282         (WebCore::PolicyChecker::extendBlobURLLifetimeIfNecessary const):
1283         (WebCore::PolicyChecker::checkNavigationPolicy):
1284         (WebCore::PolicyChecker::checkNewWindowPolicy):
1285         * loader/PolicyChecker.h:
1286
1287 2018-05-11  Antti Koivisto  <antti@apple.com>
1288
1289         LinkLoader fails to remove CachedResourceClient in some cases
1290         https://bugs.webkit.org/show_bug.cgi?id=185553
1291         <rdar://problem/36879656>
1292
1293         Reviewed by Geoffrey Garen.
1294
1295         Test: http/tests/preload/link-preload-client-remove.html
1296
1297         * loader/LinkLoader.cpp:
1298         (WebCore::LinkLoader::loadLink):
1299
1300         If there is a link preload already in progress, we fail to clear the client for the ongoing load.
1301         This may leave the CachedResource client map in a bad state.
1302
1303 2018-05-11  Charles Vazac  <cvazac@gmail.com>
1304
1305         Runtime feature flag for Server-Timing
1306         https://bugs.webkit.org/show_bug.cgi?id=184758
1307
1308         Reviewed by Youenn Fablet.
1309
1310         * Source/WebCore/CMakeLists.txt: Added reference to PerformanceServerTiming.idl.
1311         * Source/WebCore/DerivedSources.make: Added reference to PerformanceServerTiming.idl.
1312         * Source/WebCore/Sources.txt: Added reference to PerformanceServerTiming.cpp and JSPerformanceServerTiming.cpp.
1313         * Source/WebCore/WebCore.xcodeproj/project.pbxproj: Added references to PerformanceServerTiming.cpp, PerformanceServerTiming.h, and PerformanceServerTiming.idl.
1314         * Source/WebCore/bindings/js/WebCoreBuiltinNames.h: Added PerformanceServerTiming.
1315         * Source/WebCore/page/PerformanceResourceTiming.h: Added serverTiming member.
1316         * Source/WebCore/page/PerformanceResourceTiming.idl: Added serverTiming attribute.
1317         * Source/WebCore/page/PerformanceServerTiming.cpp: Added.
1318         * Source/WebCore/page/PerformanceServerTiming.h: Added.
1319         * Source/WebCore/page/PerformanceServerTiming.idl: Added.
1320
1321 2018-05-11  Brady Eidson  <beidson@apple.com>
1322
1323         Make sure history navigations reuse the existing process when necessary.
1324         <rdar://problem/39746516> and https://bugs.webkit.org/show_bug.cgi?id=185532
1325
1326         Reviewed by Ryosuke Niwa.
1327
1328         Covered by new API tests.
1329
1330         In WebCore-land, make sure *all* NavigationActions to a back/forward item are tagged with
1331         the item identifier.
1332
1333         * history/HistoryItem.cpp:
1334         (WebCore::HistoryItem::HistoryItem):
1335         (WebCore::HistoryItem::logString const):
1336         * history/HistoryItem.h:
1337
1338         * loader/FrameLoader.cpp:
1339         (WebCore::FrameLoader::loadDifferentDocumentItem):
1340
1341         * loader/NavigationAction.cpp:
1342         (WebCore::NavigationAction::setTargetBackForwardItem):
1343
1344         * loader/NavigationAction.h:
1345         (WebCore::NavigationAction::targetBackForwardItemIdentifier const):
1346
1347 2018-05-11  Yacine Bandou  <yacine.bandou_ext@softathome.com>
1348
1349         [EME][GStreamer] Handle the protection event in MediaPlayerPrivate
1350         https://bugs.webkit.org/show_bug.cgi?id=185535
1351
1352         Reviewed by Xabier Rodriguez-Calvar.
1353
1354         This patch is based on this calvaris's commit
1355         https://github.com/WebPlatformForEmbedded/WPEWebKit/commit/d966168b0d2b65f9ca9415426e26d3752c78b03e
1356
1357         It adds a handler for the protection event in MediaPalyerPrivateGStreamerBase, it extracts the InitData from the event
1358         and sends the encrypted event to JS via HTMLMediaElement.
1359         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1360         (WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered):
1361         (WebCore::MediaPlayerPrivateGStreamerBase::handleProtectionEvent):
1362         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1363         * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h: Add a new type InitData.
1364
1365 2018-05-11  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1366
1367         [Curl] Make the cipher suites, the signing algorithms and the curve lists configurable.
1368         https://bugs.webkit.org/show_bug.cgi?id=185139
1369
1370         Add interface to configure the cipher suites, the signing algorithms and the curve lists 
1371         used by OpenSSL and libcurl to exchange, to sign or to verify keys.
1372
1373         Reviewed by Youenn Fablet.
1374
1375         No new tests in public. Have tested internally.
1376
1377         * platform/network/curl/CurlContext.cpp:
1378         (WebCore::CurlHandle::setSslCipherList):
1379         * platform/network/curl/CurlContext.h:
1380         * platform/network/curl/CurlRequest.cpp:
1381         (WebCore::CurlRequest::setupTransfer):
1382         (WebCore::CurlRequest::willSetupSslCtx):
1383         * platform/network/curl/CurlSSLHandle.cpp:
1384         (WebCore::CurlSSLHandle::getCACertPathEnv):
1385         * platform/network/curl/CurlSSLHandle.h:
1386         (WebCore::CurlSSLHandle::getCipherList const):
1387         (WebCore::CurlSSLHandle::getSignatureAlgorithmsList const):
1388         (WebCore::CurlSSLHandle::getCurvesList const):
1389         (WebCore::CurlSSLHandle::setCipherList):
1390         (WebCore::CurlSSLHandle::setSignatureAlgorithmsList):
1391         (WebCore::CurlSSLHandle::setCurvesList):
1392         (WebCore::CurlSSLHandle::getCACertPath const):
1393         (WebCore::CurlSSLHandle::setCACertPath):
1394         * platform/network/curl/CurlSSLVerifier.cpp:
1395         (WebCore::CurlSSLVerifier::CurlSSLVerifier):
1396
1397 2018-05-10  Daniel Bates  <dabates@apple.com>
1398
1399         Use PlatformStrategies to switch between WebKit and WebKitLegacy checking of CSP frame-ancestors and X-Frame-Options
1400         https://bugs.webkit.org/show_bug.cgi?id=185412
1401
1402         Reviewed by Ryosuke Niwa.
1403
1404         Consolidate the knowledge on how to determine whether security checks were performed on a ResourceResponse
1405         into LoaderStrategy::havePerformedSecurityChecks() (default implementation returns false) and query it
1406         to determine whether CSP frame-ancestors and X-Frame-Options need to be checked for a ResourceResponse.
1407
1408         Additionally, rename LoaderStrategy::isDoingLoadingSecurityChecks() to shouldPerformSecurityChecks()
1409         for consistency with havePerformedSecurityChecks(). Querying shouldPerformSecurityChecks() answers the
1410         question of whether the loader strategy is responsible for performing security checks when building up
1411         a ResourceRequest to have the loader strategy load. And LoaderStrategy::havePerformedSecurityChecks()
1412         is used to determine whether the loader strategy performed these security checks for a given ResourceResponse.
1413
1414         * inspector/agents/InspectorNetworkAgent.cpp:
1415         (WebCore::InspectorNetworkAgent::didReceiveResponse):
1416         (WebCore::InspectorNetworkAgent::didFinishLoading):
1417         (WebCore::isResponseProbablyComingFromNetworkProcess): Deleted.
1418         * loader/DocumentLoader.cpp:
1419         (WebCore::DocumentLoader::responseReceived):
1420         * loader/DocumentThreadableLoader.cpp:
1421         (WebCore::shouldPerformSecurityChecks):
1422         (WebCore::DocumentThreadableLoader::shouldSetHTTPHeadersToKeep const):
1423         (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
1424         (WebCore::DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest):
1425         (WebCore::DocumentThreadableLoader::redirectReceived):
1426         (WebCore::DocumentThreadableLoader::didFail):
1427         (WebCore::DocumentThreadableLoader::loadRequest):
1428         (WebCore::isDoingSecurityChecksInNetworkProcess): Deleted.
1429         (WebCore::isResponseComingFromNetworkProcess): Deleted.
1430         * loader/LoaderStrategy.cpp:
1431         * loader/LoaderStrategy.h:
1432         * page/Settings.yaml: Remove setting networkProcessCSPFrameAncestorsCheckingEnabled as we now make
1433         use of the loader strategy to determine whether to perform CSP frame-ancestors and X-Frame-Options
1434         checking in DocumentLoader.
1435         * platform/network/ResourceResponseBase.h:
1436         (WebCore::ResourceResponseBase::setSource): Added an ASSERT to catch the programming error of setting
1437         source to ResourceResponse::Source::Unknown. This source type represents an uninitialized ResourceResponse.
1438
1439 2018-05-10  Tim Horton  <timothy_horton@apple.com>
1440
1441         Lookup sometimes shows a second yellow highlight on top of WebKit's TextIndicator
1442         https://bugs.webkit.org/show_bug.cgi?id=185538
1443         <rdar://problem/38817825>
1444
1445         Reviewed by Sam Weinig.
1446
1447         * editing/mac/DictionaryLookup.mm:
1448         (WebCore::showPopupOrCreateAnimationController):
1449         Options can be nil, in which case we can't mutableCopy it and add
1450         LUTermOptionDisableSearchTermIndicator. Instead, create a new dictionary,
1451         and add the items from options, if it's not nil.
1452
1453 2018-05-10  Matt Baker  <mattbaker@apple.com>
1454
1455         Web Inspector: ASSERT_NOT_REACHED in PageDebuggerAgent::didAddEventListener when page adds attribute event listener
1456         https://bugs.webkit.org/show_bug.cgi?id=181580
1457         <rdar://problem/36461309>
1458
1459         Reviewed by Brian Burg.
1460
1461         EventTarget should pass newly added EventListeners to InspectorInstrumentation,
1462         instead of PageDebuggerAgent assuming the last item in the EventListenerVector
1463         is the most recently added listener. This assumption does not hold when
1464         the new listener replaces an existing listener.
1465
1466         * dom/EventTarget.cpp:
1467         (WebCore::EventTarget::addEventListener):
1468         (WebCore::EventTarget::setAttributeEventListener):
1469
1470         * inspector/InspectorInstrumentation.cpp:
1471         (WebCore::InspectorInstrumentation::didAddEventListenerImpl):
1472
1473         * inspector/InspectorInstrumentation.h:
1474         (WebCore::InspectorInstrumentation::didAddEventListener):
1475
1476         * inspector/agents/page/PageDebuggerAgent.cpp:
1477         (WebCore::PageDebuggerAgent::didAddEventListener):
1478         * inspector/agents/page/PageDebuggerAgent.h:
1479
1480 2018-05-10  Chris Dumez  <cdumez@apple.com>
1481
1482         'Cross-Origin-Options header implementation follow-up
1483         https://bugs.webkit.org/show_bug.cgi?id=185520
1484
1485         Reviewed by Ryosuke Niwa.
1486
1487         * dom/Document.cpp:
1488         * dom/Document.h:
1489         * loader/FrameLoader.cpp:
1490         (WebCore::FrameLoader::didBeginDocument):
1491         Using isNull() check is sufficient here as the header parsing
1492         function will do the right thing when passed the empty string.
1493         Also set the options directly on the window instead of the
1494         document. The window is guaranteed to have been constructed
1495         by then because didBeginDocument() is called DocumentWriter::begin()
1496         which calls Document::createDOMWindow() or Document::takeDOMWindowFrom().
1497
1498         * page/AbstractDOMWindow.cpp:
1499         (WebCore::AbstractDOMWindow::AbstractDOMWindow):
1500         * page/AbstractDOMWindow.h:
1501         * page/DOMWindow.cpp:
1502         (WebCore::DOMWindow::DOMWindow):
1503         (WebCore::DOMWindow::didSecureTransitionTo):
1504         * page/RemoteDOMWindow.cpp:
1505         (WebCore::RemoteDOMWindow::RemoteDOMWindow):
1506         * page/RemoteDOMWindow.h:
1507         CrossOriginOptions are now stored only on the Window, not the Document.
1508
1509         * platform/network/HTTPParsers.cpp:
1510         (WebCore::parseCrossOriginOptionsHeader):
1511         Drop strippedHeader local variable as it is not strictly needed.
1512
1513 2018-05-10  Tim Horton  <timothy_horton@apple.com>
1514
1515         Fix the build after r231393
1516         https://bugs.webkit.org/show_bug.cgi?id=185519
1517         <rdar://problem/40131741>
1518
1519         Reviewed by Simon Fraser.
1520
1521         * Configurations/WebCore.xcconfig:
1522
1523 2018-05-10  Eric Carlson  <eric.carlson@apple.com>
1524
1525         Log missing cues correctly
1526         https://bugs.webkit.org/show_bug.cgi?id=185499
1527         <rdar://problem/40113821>
1528
1529         Reviewed by Daniel Bates.
1530
1531         No new tests, tested manually.
1532
1533         * html/track/InbandGenericTextTrack.cpp:
1534         (WebCore::InbandGenericTextTrack::removeGenericCue): Log the cue we searched for, not
1535         the NULL cue.
1536
1537 2018-05-10  Zalan Bujtas  <zalan@apple.com>
1538
1539         [LFC] Implement height computation for non-replaced inflow elements.
1540         https://bugs.webkit.org/show_bug.cgi?id=185474
1541
1542         Reviewed by Antti Koivisto.
1543
1544         Initial implementation. Does not cover all the cases.
1545
1546         * layout/FormattingContext.cpp:
1547         (WebCore::Layout::FormattingContext::computeHeight const):
1548         * layout/FormattingContext.h:
1549         * layout/blockformatting/BlockFormattingContext.cpp:
1550         (WebCore::Layout::BlockFormattingContext::layout const):
1551         (WebCore::Layout::BlockFormattingContext::computeInFlowHeight const):
1552         (WebCore::Layout::BlockFormattingContext::computeInFlowNonReplacedHeight const):
1553         * layout/blockformatting/BlockFormattingContext.h:
1554         * layout/blockformatting/BlockMarginCollapse.cpp:
1555         (WebCore::Layout::collapsedMarginBottomFromLastChild):
1556         (WebCore::Layout::BlockMarginCollapse::isMarginBottomCollapsedWithParent):
1557         (WebCore::Layout::BlockMarginCollapse::isMarginTopCollapsedWithParentMarginBottom):
1558         (WebCore::Layout::isMarginBottomCollapsedWithParent): Deleted.
1559         * layout/blockformatting/BlockMarginCollapse.h:
1560         * layout/inlineformatting/InlineFormattingContext.cpp:
1561         (WebCore::Layout::InlineFormattingContext::computeInFlowHeight const):
1562         * layout/inlineformatting/InlineFormattingContext.h:
1563         * layout/layouttree/LayoutBox.cpp:
1564         (WebCore::Layout::Box::isReplaced const):
1565         * layout/layouttree/LayoutBox.h:
1566
1567 2018-05-10  Thibault Saunier  <tsaunier@igalia.com>
1568
1569         [GTK] Implement ImageBuffer::toBGRAData
1570         https://bugs.webkit.org/show_bug.cgi?id=185511
1571
1572         Reviewed by Michael Catanzaro.
1573
1574         This was never implemented but will be required for the MediaStream API
1575         tests.
1576
1577         * platform/graphics/ImageBuffer.cpp:
1578         (WebCore::ImageBuffer::toBGRAData const):
1579         * platform/graphics/cg/ImageBufferCG.cpp:
1580         (WebCore::ImageBuffer::toBGRAData const):
1581         * platform/graphics/gtk/ImageBufferGtk.cpp:
1582         (WebCore::ImageBuffer::toBGRAData const):
1583
1584 2018-05-10  Yacine Bandou  <yacine.bandou_ext@softathome.com>
1585
1586         [EME][GStreamer] Add a handler for GStreamer protection event
1587         https://bugs.webkit.org/show_bug.cgi?id=185245
1588
1589         Reviewed by Xabier Rodriguez-Calvar.
1590
1591         Qtdemux sends the protection event when encountered a new PSSH box (encrypted content).
1592
1593         The Decryptor is moved from AppendPipeline to PlaybackPipeline (see https://bugs.webkit.org/show_bug.cgi?id=181855),
1594         thus the protection event is no longer handled because the Decryptor is not in the same pipeline as qtdemux.
1595
1596         AppendPipeline: httpsrc-->qtdemux-->appsink
1597         PlaybackPipeline: appsrc-->parser--> decryptor-->decoder-->sink
1598
1599         This patch attaches a probe to the sink pad of the appsink in the appendPipeline in order to
1600         catch and manage the protection event.
1601
1602         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1603         (WebCore::AppendPipeline::AppendPipeline):
1604         (WebCore::AppendPipeline::~AppendPipeline):
1605         (WebCore::appendPipelineAppsinkPadEventProbe):
1606         * platform/graphics/gstreamer/mse/AppendPipeline.h:
1607         (WebCore::AppendPipeline::playerPrivate):
1608
1609 2018-05-10  Yacine Bandou  <yacine.bandou_ext@softathome.com>
1610
1611         [EME][GStreamer] Move the decryptor from AppendPipeline to PlaybackPipeline.
1612         https://bugs.webkit.org/show_bug.cgi?id=181855
1613
1614         Reviewed by Xabier Rodriguez-Calvar.
1615
1616         The goal of this move is to handle the limitation of SVP (Secure Video Path) memory size.
1617
1618         When the decryptor is in the AppendPipeline and we use SVP, we buffer in MediaSource queue
1619         the decrypted GstBuffers that are in SVP memory.
1620         This behavior cause an out-of-memory error, because we are limited in SVP memory size.
1621
1622         By moving the decryptor in PlaybackPipeline, we avoid to buffer the decrypted GstBuffers
1623         which use the SVP memory and we buffer the encrypted GstBuffers that are in system memory.
1624
1625         This new architecture also allows to start the buffering before obtaining the DRM license
1626         and it makes easier to manage dynamic change of the license or Key.
1627
1628         The decryptor is auto plugged by GStreamer playbin in PlaybackPipeline.
1629
1630         SVP: Secure Video Path also named trusted or protected video path, it is a memory which is
1631         protected by a hardware access control engine, it is not accessible to other unauthorised
1632         software or hardware components.
1633
1634         Tests:
1635             media/encrypted-media/clearKey/clearKey-cenc-audio-playback-mse.html
1636             media/encrypted-media/clearKey/clearKey-cenc-video-playback-mse.html
1637
1638         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
1639         (webkitMediaCommonEncryptionDecryptSinkEventHandler):
1640         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1641         (WebCore::dumpAppendState):
1642         (WebCore::AppendPipeline::AppendPipeline):
1643         (WebCore::AppendPipeline::handleNeedContextSyncMessage):
1644         (WebCore::AppendPipeline::handleAppsrcNeedDataReceived):
1645         (WebCore::AppendPipeline::setAppendState):
1646         (WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
1647         (WebCore::AppendPipeline::appsinkNewSample):
1648         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
1649         (WebCore::AppendPipeline::disconnectDemuxerSrcPadFromAppsinkFromAnyThread):
1650         (WebCore::appendPipelineElementMessageCallback): Deleted.
1651         (WebCore::AppendPipeline::handleElementMessage): Deleted.
1652         (WebCore::AppendPipeline::dispatchPendingDecryptionStructure): Deleted.
1653         (WebCore::AppendPipeline::dispatchDecryptionStructure): Deleted.
1654         * platform/graphics/gstreamer/mse/AppendPipeline.h:
1655         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
1656         (WebCore::MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithInstance):
1657         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
1658
1659 2018-05-09  Nan Wang  <n_wang@apple.com>
1660
1661         AX: VoiceOver iframe scrolling focus jumping bug
1662         https://bugs.webkit.org/show_bug.cgi?id=176615
1663         <rdar://problem/34333067>
1664
1665         Reviewed by Chris Fleizach.
1666
1667         Scrolling to make elements visible is not working correctly for elements inside an
1668         offscreen iframe. Fixed it by using RenderLayer::scrollRectToVisible() to handle
1669         scrolling more properly.
1670
1671         Test: accessibility/scroll-to-make-visible-iframe-offscreen.html
1672
1673         * accessibility/AccessibilityObject.cpp:
1674         (WebCore::AccessibilityObject::scrollToMakeVisible const):
1675
1676 2018-05-09  Joanmarie Diggs  <jdiggs@igalia.com>
1677
1678         AX: accessibleNameForNode should simplify whitespace when using innerText
1679         https://bugs.webkit.org/show_bug.cgi?id=185498
1680
1681         Reviewed by Chris Fleizach.
1682
1683         Test: accessibility/text-alternative-calculation-from-unrendered-table.html
1684
1685         Call simplifyWhiteSpace() before returning the innerText value.
1686
1687         * accessibility/AccessibilityNodeObject.cpp:
1688         (WebCore::accessibleNameForNode):
1689
1690 2018-05-09  Chris Dumez  <cdumez@apple.com>
1691
1692         Add initial support for 'Cross-Origin-Options' HTTP response header
1693         https://bugs.webkit.org/show_bug.cgi?id=184996
1694         <rdar://problem/39664620>
1695
1696         Reviewed by Geoff Garen.
1697
1698         Add initial support for 'Cross-Origin-Options' HTTP response header behind an experimental
1699         feature flag, on by default. When the HTTP server services this HTTP response header for a
1700         main resource, we'll set these options on the corresponding Document. This will impact the
1701         behavior of the Document's associated Window API when cross-origin.
1702
1703         The HTTP header has 3 possible values:
1704         - allow: This is the default. Regular cross-origin Window API is available.
1705         - allow-postmessage: Only postMessage() is available on a cross-origin window, trying to
1706           access anything else will throw a SecurityError.
1707         - deny: Trying to do anything with a cross-origin window will throw a SecurityError.
1708
1709         The header has no effect when accessing same origin windows.
1710
1711         Note that on cross-origin access from Window A to Window B, we check the cross-origin
1712         options for both Window A and Window B and use the lowest common denominator as effective
1713         cross-origin options for the access. So if Window A has 'Cross-Origin-Options: deny' and
1714         tries to call postMessage() on Window B which has 'Cross-Origin-Options: allow-postmessage',
1715         we will throw a SecurityError. This is because Window A's more restrictive options (deny)
1716         apply.
1717
1718         Tests: http/wpt/cross-origin-options/allow-postmessage-from-deny.html
1719                http/wpt/cross-origin-options/allow-postmessage.html
1720                http/wpt/cross-origin-options/cross-origin-options-header.html
1721
1722         * bindings/js/JSDOMBindingSecurity.cpp:
1723         (WebCore::BindingSecurity::shouldAllowAccessToDOMWindowGivenMinimumCrossOriginOptions):
1724         * bindings/js/JSDOMBindingSecurity.h:
1725         * bindings/js/JSDOMWindowCustom.cpp:
1726         (WebCore::effectiveCrossOriginOptionsForAccess):
1727         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
1728         (WebCore::JSDOMWindow::getOwnPropertySlot):
1729         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
1730         (WebCore::addCrossOriginWindowPropertyNames):
1731         (WebCore::addScopedChildrenIndexes):
1732         (WebCore::addCrossOriginWindowOwnPropertyNames):
1733         (WebCore::JSDOMWindow::getOwnPropertyNames):
1734         * bindings/js/JSDOMWindowCustom.h:
1735         * bindings/js/JSRemoteDOMWindowCustom.cpp:
1736         (WebCore::JSRemoteDOMWindow::getOwnPropertySlot):
1737         (WebCore::JSRemoteDOMWindow::getOwnPropertySlotByIndex):
1738         (WebCore::JSRemoteDOMWindow::getOwnPropertyNames):
1739         * bindings/scripts/CodeGeneratorJS.pm:
1740         (GenerateAttributeGetterBodyDefinition):
1741         (GetCrossOriginsOptionsFromExtendedAttributeValue):
1742         (GenerateAttributeSetterBodyDefinition):
1743         (GenerateOperationBodyDefinition):
1744         * bindings/scripts/IDLAttributes.json:
1745         * dom/Document.cpp:
1746         (WebCore::Document::setCrossOriginOptions):
1747         * dom/Document.h:
1748         (WebCore::Document::crossOriginOptions const):
1749         * loader/FrameLoader.cpp:
1750         (WebCore::FrameLoader::didBeginDocument):
1751         * page/AbstractDOMWindow.cpp:
1752         (WebCore::AbstractDOMWindow::AbstractDOMWindow):
1753         * page/AbstractDOMWindow.h:
1754         (WebCore::AbstractDOMWindow::crossOriginOptions):
1755         (WebCore::AbstractDOMWindow::setCrossOriginOptions):
1756         * page/DOMWindow.cpp:
1757         (WebCore::DOMWindow::DOMWindow):
1758         (WebCore::DOMWindow::didSecureTransitionTo):
1759         * page/DOMWindow.idl:
1760         * page/Frame.h:
1761         * page/RemoteDOMWindow.cpp:
1762         (WebCore::RemoteDOMWindow::RemoteDOMWindow):
1763         * page/RemoteDOMWindow.h:
1764         * page/Settings.yaml:
1765         * platform/network/HTTPHeaderNames.in:
1766         * platform/network/HTTPParsers.cpp:
1767         (WebCore::parseCrossOriginOptionsHeader):
1768         * platform/network/HTTPParsers.h:
1769
1770 2018-05-09  Ryosuke Niwa  <rniwa@webkit.org>
1771
1772         Release assert in TreeScopeOrderedMap::remove via HTMLImageElement::removedFromAncestor
1773         https://bugs.webkit.org/show_bug.cgi?id=185493
1774
1775         Reviewed by Brent Fulgham.
1776
1777         Fixed the bug that HTMLImageElement::removedFromAncestor and HTMLMapElement::removedFromAncestor
1778         were calling removeImageElementByUsemap on the document instead of the shadow tree from which it was removed.
1779
1780         Test: fast/images/imagemap-in-shadow-tree-removed.html
1781
1782         * html/HTMLImageElement.cpp:
1783         (WebCore::HTMLImageElement::removedFromAncestor):
1784         * html/HTMLMapElement.cpp:
1785         (WebCore::HTMLMapElement::removedFromAncestor):
1786
1787 2018-05-09  Joanmarie Diggs  <jdiggs@igalia.com>
1788
1789         AX: Hidden nodes which are not directly referenced should not participate name/description from content
1790         https://bugs.webkit.org/show_bug.cgi?id=185478
1791
1792         Reviewed by Chris Fleizach.
1793
1794         Add a check to AccessibilityNodeObject::textUnderElement() and return early
1795         if the node is hidden, not referenced by aria-labelledby or aria-describedby,
1796         not an HTMLLabelElement, and not fallback content for an HTMLCanvasElement.
1797
1798         Test: accessibility/text-alternative-calculation-hidden-nodes.html
1799
1800         * accessibility/AccessibilityNodeObject.cpp:
1801         (WebCore::AccessibilityNodeObject::textUnderElement const):
1802
1803 2018-05-09  Eric Carlson  <eric.carlson@apple.com>
1804
1805         Update MediaSession to use release logging
1806         https://bugs.webkit.org/show_bug.cgi?id=185376
1807         <rdar://problem/40022203>
1808
1809         Reviewed by Youenn Fablet.
1810
1811         No new tests, tested manually.
1812
1813         * Modules/mediastream/MediaStream.h: hostingDocument() doesn't need to return a const Document.
1814         * Modules/webaudio/AudioContext.cpp:
1815         (WebCore::AudioContext::hostingDocument const): Ditto.
1816         * Modules/webaudio/AudioContext.h:
1817
1818         * html/HTMLMediaElement.h: Ditto.
1819
1820         * html/MediaElementSession.cpp:
1821         (WebCore::MediaElementSession::MediaElementSession):
1822         (WebCore::MediaElementSession::addBehaviorRestriction):
1823         (WebCore::MediaElementSession::removeBehaviorRestriction):
1824         (WebCore::MediaElementSession::dataLoadingPermitted const):
1825         (WebCore::MediaElementSession::fullscreenPermitted const):
1826         (WebCore::MediaElementSession::pageAllowsDataLoading const):
1827         (WebCore::MediaElementSession::pageAllowsPlaybackAfterResuming const):
1828         (WebCore::MediaElementSession::canShowControlsManager const):
1829         (WebCore::MediaElementSession::showPlaybackTargetPicker):
1830         (WebCore::MediaElementSession::hasWirelessPlaybackTargets const):
1831         (WebCore::MediaElementSession::wirelessVideoPlaybackDisabled const):
1832         (WebCore::MediaElementSession::setWirelessVideoPlaybackDisabled):
1833         (WebCore::MediaElementSession::setHasPlaybackTargetAvailabilityListeners):
1834         (WebCore::MediaElementSession::externalOutputDeviceAvailableDidChange):
1835         (WebCore::MediaElementSession::setShouldPlayToPlaybackTarget):
1836         (WebCore::MediaElementSession::mediaEngineUpdated):
1837         (WebCore::MediaElementSession::willLog const): Deleted.
1838         (WebCore::MediaElementSession::logger const): Deleted.
1839         (WebCore::MediaElementSession::logIdentifier const): Deleted.
1840         (WebCore::MediaElementSession::logChannel const): Deleted.
1841         * html/MediaElementSession.h:
1842
1843         * platform/audio/PlatformMediaSession.cpp:
1844         (WebCore::nextLogIdentifier):
1845         (WebCore::convertEnumerationToString):
1846         (WebCore::PlatformMediaSession::PlatformMediaSession):
1847         (WebCore::PlatformMediaSession::setState):
1848         (WebCore::PlatformMediaSession::beginInterruption):
1849         (WebCore::PlatformMediaSession::endInterruption):
1850         (WebCore::PlatformMediaSession::clientWillBeginAutoplaying):
1851         (WebCore::PlatformMediaSession::clientWillPausePlayback):
1852         (WebCore::PlatformMediaSession::pauseSession):
1853         (WebCore::PlatformMediaSession::stopSession):
1854         (WebCore::PlatformMediaSession::clientDataBufferingTimerFired):
1855         (WebCore::PlatformMediaSession::logChannel const):
1856         (WebCore::stateName): Deleted.
1857         (WebCore::interruptionName): Deleted.
1858         * platform/audio/PlatformMediaSession.h:
1859         (WTF::LogArgument<WebCore::PlatformMediaSession::State>::toString):
1860         (WTF::LogArgument<WebCore::PlatformMediaSession::InterruptionType>::toString):
1861
1862 2018-05-09  Thibault Saunier  <tsaunier@igalia.com>
1863
1864         [GStreamer] Never call updateTracks if running on legacy pipeline
1865         https://bugs.webkit.org/show_bug.cgi?id=184581
1866
1867         This makes sure failling code path is never reached in the conditions where it should not have been reached.
1868
1869         Reviewed by Philippe Normand.
1870
1871         Re enables all tests that were disabled after fixing.
1872
1873         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1874         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
1875
1876 2018-05-09  Daniel Bates  <dabates@apple.com>
1877
1878         REGRESSION (r231479): http/tests/appcache/x-frame-options-prevents-framing.php is timing out
1879         https://bugs.webkit.org/show_bug.cgi?id=185443
1880         <rdar://problem/40100660>
1881
1882         Reviewed by Andy Estes.
1883
1884         Following r231479 when using WebKit2 and Restricted HTTP Response Access is enabled (enabled in
1885         WebKitTestRunner) we only check the CSP frame-ancestors directive and X-Frame-Options in
1886         NetworkProcess. We need to check these security requirements in WebContent process whenever
1887         we are performing a substitute data load, such as for app cache, as these loads do not go
1888         through NetworkProcess.
1889
1890         * loader/DocumentLoader.cpp:
1891         (WebCore::DocumentLoader::responseReceived):
1892
1893 2018-05-09  Justin Fan  <justin_fan@apple.com>
1894
1895         Hooked up ASTC support in WebGL; requires OpenGL ES 3 context to work. 
1896         https://bugs.webkit.org/show_bug.cgi?id=185272
1897         <rdar://problem/15745737>
1898
1899         Reviewed by Dean Jackson.
1900
1901         Also added in Khronos' ASTC test from version 1.0.4 beta of their conformance test suite,
1902         although again, this requires OpenGL ES 3 context for WebKit to detect proper support.
1903
1904         Test: fast/canvas/webgl/webgl-compressed-texture-astc.html
1905
1906         * DerivedSources.make:
1907         * Sources.txt:
1908         * WebCore.xcodeproj/project.pbxproj:
1909         * bindings/js/JSDOMConvertWebGL.cpp:
1910         (WebCore::convertToJSValue):
1911         * html/canvas/WebGL2RenderingContext.cpp:
1912         (WebCore::WebGL2RenderingContext::getExtension):
1913         (WebCore::WebGL2RenderingContext::getSupportedExtensions):
1914         * html/canvas/WebGLCompressedTextureASTC.cpp: Added.
1915         (WebCore::WebGLCompressedTextureASTC::WebGLCompressedTextureASTC):
1916         (WebCore::WebGLCompressedTextureASTC::getName const):
1917         (WebCore::WebGLCompressedTextureASTC::supported):
1918         (WebCore::WebGLCompressedTextureASTC::getSupportedProfiles):
1919         * html/canvas/WebGLCompressedTextureASTC.h: Added.
1920         * html/canvas/WebGLCompressedTextureASTC.idl: Added.
1921         * html/canvas/WebGLExtension.h:
1922         * html/canvas/WebGLRenderingContext.cpp:
1923         (WebCore::WebGLRenderingContext::getExtension):
1924         (WebCore::WebGLRenderingContext::getSupportedExtensions):
1925         * html/canvas/WebGLRenderingContextBase.cpp:
1926         (WebCore::WebGLRenderingContextBase::validateCompressedTexFuncData):
1927         (WebCore::WebGLRenderingContextBase::validateCompressedTexDimensions):
1928         * html/canvas/WebGLRenderingContextBase.h:
1929         * platform/graphics/Extensions3D.h:
1930
1931 2018-05-09  Youenn Fablet  <youenn@apple.com>
1932
1933         Allow WebResourceLoader to cancel a load served from a service worker
1934         https://bugs.webkit.org/show_bug.cgi?id=185274
1935
1936         Reviewed by Chris Dumez.
1937
1938         Add support for cancelling a fetch from WebProcess to service worker process.
1939         Use FetchIdentifier instead of uint64_t.
1940
1941         * Modules/fetch/FetchIdentifier.h: Added.
1942         * WebCore.xcodeproj/project.pbxproj:
1943         * workers/service/context/ServiceWorkerFetch.h:
1944         * workers/service/context/ServiceWorkerThreadProxy.cpp:
1945         (WebCore::ServiceWorkerThreadProxy::startFetch):
1946         (WebCore::ServiceWorkerThreadProxy::cancelFetch):
1947         * workers/service/context/ServiceWorkerThreadProxy.h:
1948
1949 2018-05-09  Thibault Saunier  <tsaunier@igalia.com>
1950
1951         [GStreamer] Fix style issue in MediaPlayerPrivateGStreamer
1952         https://bugs.webkit.org/show_bug.cgi?id=185479
1953
1954         Reviewed by Philippe Normand.
1955
1956         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:114:  Multi line control clauses should use braces.  [whitespace/braces] [4]
1957         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:194:  Multi line control clauses should use braces.  [whitespace/braces] [4]
1958         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:398:  One line control clauses should not use braces.  [whitespace/braces] [4]
1959         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:440:  One line control clauses should not use braces.  [whitespace/braces] [4]
1960         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:806:  More than one command on the same line  [whitespace/newline] [4]
1961         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:869:  More than one command on the same line  [whitespace/newline] [4]
1962         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:880:  More than one command on the same line  [whitespace/newline] [4]
1963         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:940:  More than one command on the same line  [whitespace/newline] [4]
1964         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:1102:  Multi line control clauses should use braces.  [whitespace/braces] [4]
1965         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:1109:  Multi line control clauses should use braces.  [whitespace/braces] [4]
1966
1967         Indentation and style issue fixed only.
1968
1969         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1970         (WebCore::MediaPlayerPrivateGStreamer::registerMediaEngine):
1971         (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
1972         (WebCore::MediaPlayerPrivateGStreamer::changePipelineState):
1973         (WebCore::MediaPlayerPrivateGStreamer::play):
1974         (WebCore::MediaPlayerPrivateGStreamer::videoChangedCallback):
1975         (WebCore::MediaPlayerPrivateGStreamer::videoSinkCapsChangedCallback):
1976         (WebCore::MediaPlayerPrivateGStreamer::audioChangedCallback):
1977         (WebCore::MediaPlayerPrivateGStreamer::textChangedCallback):
1978         (WebCore::MediaPlayerPrivateGStreamer::buffered const):
1979         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
1980
1981 2018-05-09  Daniel Bates  <dabates@apple.com>
1982
1983         REGRESSION (r231479): com.apple.WebCore crash in WebCore::DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied()
1984         https://bugs.webkit.org/show_bug.cgi?id=185475
1985         <rdar://problem/40093853>
1986
1987         Reviewed by Andy Estes.
1988
1989         DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied() must extends its lifetime
1990         until completion as dispatching a DOM load event at the associated frame can cause JavaScript execution
1991         that can do anything, including destroying the loader that dispatched the event.
1992
1993         Following r231479 DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied() is now
1994         invoked by both DocumentLoader::responseReceived() and WebResourceLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied().
1995         The latter only can happen when using WebKit2 and the experimental feature Restricted HTTP Response Access
1996         is enabled (RuntimeEnabledFeatures::sharedFeatures().restrictedHTTPResponseAccess()). Unlike DocumentLoader::responseReceived()
1997         WebResourceLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied() does not take out a ref
1998         on the DocumentLoader before invoking DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied().
1999         Therefore, DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied() can cause its
2000         own destruction as a result of dispatching a DOM load event at the frame. We should take out a ref on
2001         the DocumentLoader when executing DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied().
2002
2003         * loader/DocumentLoader.cpp:
2004         (WebCore::DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied):
2005
2006 2018-05-09  Tim Horton  <timothy_horton@apple.com>
2007
2008         Fix the build by ignoring some deprecation warnings
2009
2010         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2011         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep):
2012
2013 2018-05-09  Michael Catanzaro  <mcatanzaro@igalia.com>
2014
2015         [WPE] Build cleanly with GCC 8 and ICU 60
2016         https://bugs.webkit.org/show_bug.cgi?id=185462
2017
2018         Reviewed by Carlos Alberto Lopez Perez.
2019
2020         * PlatformGTK.cmake: Include directories are in the wrong place.
2021         * accessibility/AXObjectCache.cpp: Silence -Wclass-memaccess problems and leave warnings.
2022         (WebCore::AXObjectCache::startOrEndTextMarkerDataForRange):
2023         (WebCore::AXObjectCache::textMarkerDataForCharacterOffset):
2024         (WebCore::AXObjectCache::textMarkerDataForVisiblePosition):
2025         (WebCore::AXObjectCache::textMarkerDataForFirstPositionInTextControl):
2026         * css/CSSFontFace.cpp: Silence -Wfallthrough
2027         (WebCore::CSSFontFace::fontLoadTiming const):
2028         * css/CSSSelectorList.cpp: Silence -Wclass-memaccess, this one is intentional.
2029         (WebCore::CSSSelectorList::adoptSelectorVector):
2030         * editing/TextIterator.cpp: Silence ICU deprecation warnings.
2031         * platform/Length.h:
2032         (WebCore::Length::operator=): More -Wclass-memaccess, looks benign.
2033         * platform/graphics/Gradient.cpp:
2034         (WebCore::Gradient::hash const): -Wclass-memaccess again. Leave a warning.
2035         * platform/graphics/SurrogatePairAwareTextIterator.cpp: Silence ICU deprecation warnings.
2036         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
2037         (WebCore::FontCascade::fontForCombiningCharacterSequence const): Silence ICU deprecation.
2038         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
2039         (WebCore::FontCustomPlatformData::FontCustomPlatformData): Silence -Wcast-function-type.
2040         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
2041         (WebCore::Font::canRenderCombiningCharacterSequence const): Silence ICU deprecation.
2042         * platform/graphics/gstreamer/GstAllocatorFastMalloc.cpp:
2043         (gstAllocatorFastMallocMemUnmap): Fix -Wcast-function-type.
2044         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2045         (WebCore::MediaPlayerPrivateGStreamer::updateTracks): Fix bad printf.
2046         (WebCore::MediaPlayerPrivateGStreamer::enableTrack): Another bad printf.
2047         (WebCore::findHLSQueue): Fix -Wcast-function-type.
2048         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
2049         (webKitMediaClearKeyDecryptorDecrypt): Fix another bad printf.
2050         * platform/network/soup/SocketStreamHandleImplSoup.cpp: Silence -Wcast-function-type.
2051         (WebCore::SocketStreamHandleImpl::beginWaitingForSocketWritability):
2052         * platform/text/TextEncoding.cpp: Silence ICU deprecration.
2053
2054 2018-05-08  Simon Fraser  <simon.fraser@apple.com>
2055
2056         SVG lighting colors need to be converted into linearSRGB
2057         https://bugs.webkit.org/show_bug.cgi?id=181196
2058
2059         Reviewed by Darin Adler.
2060
2061         Address post-commit comments. Don't make a Color that contains linearRGB components,
2062         but use FloatComponents instead. Since these FloatComponents are in the 0-1 range,
2063         FELighting::setPixelInternal() needs to multiply by 255 since the output pixels are
2064         8-bit 0-255.
2065         
2066         Change linearToSRGBColorComponent() and sRGBToLinearColorComponent() to do math in
2067         floats without promoting to doubles.
2068
2069         * platform/graphics/ColorUtilities.cpp:
2070         (WebCore::FloatComponents::FloatComponents):
2071         (WebCore::linearToSRGBColorComponent):
2072         (WebCore::sRGBToLinearColorComponent):
2073         (WebCore::sRGBColorToLinearComponents):
2074         (WebCore::linearToSRGBColor): Deleted.
2075         (WebCore::sRGBToLinearColor): Deleted.
2076         * platform/graphics/ColorUtilities.h:
2077         * platform/graphics/filters/FELighting.cpp:
2078         (WebCore::FELighting::setPixelInternal):
2079         (WebCore::FELighting::drawLighting):
2080
2081 2018-05-09  Timothy Hatcher  <timothy@apple.com>
2082
2083         Use StyleColor::Options in more places.
2084
2085         https://bugs.webkit.org/show_bug.cgi?id=185458
2086         rdar://problem/39853798
2087
2088         Add UseDefaultAppearance to StyleColor::Options, to avoid passing yet another
2089         boolean on some of these functions.
2090
2091         Reviewed by Tim Horton.
2092
2093         * css/MediaQueryEvaluator.cpp:
2094         * css/StyleColor.h:
2095         * dom/Document.cpp:
2096         (WebCore::Document::useDefaultAppearance const):
2097         (WebCore::Document::styleColorOptions const):
2098         * dom/Document.h:
2099         * platform/Theme.cpp:
2100         (WebCore::Theme::paint):
2101         * platform/Theme.h:
2102         * platform/mac/LocalDefaultSystemAppearance.h:
2103         * platform/mac/LocalDefaultSystemAppearance.mm:
2104         (WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
2105         (WebCore::LocalDefaultSystemAppearance::~LocalDefaultSystemAppearance):
2106         * platform/mac/ThemeMac.h:
2107         * platform/mac/ThemeMac.mm:
2108         (WebCore::paintToggleButton):
2109         (WebCore::paintButton):
2110         (WebCore::ThemeMac::ensuredView):
2111         (WebCore::ThemeMac::drawCellOrFocusRingWithViewIntoContext):
2112         (WebCore::ThemeMac::paint):
2113         (-[WebCoreThemeView initWithUseSystemAppearance:]): Deleted.
2114         * platform/wpe/ThemeWPE.cpp:
2115         (WebCore::ThemeWPE::paint):
2116         * platform/wpe/ThemeWPE.h:
2117         * rendering/RenderListBox.cpp:
2118         (WebCore::RenderListBox::paintItemBackground):
2119         * rendering/RenderTheme.cpp:
2120         (WebCore::RenderTheme::paint):
2121         (WebCore::RenderTheme::inactiveListBoxSelectionBackgroundColor const):
2122         (WebCore::RenderTheme::platformInactiveListBoxSelectionBackgroundColor const):
2123         * rendering/RenderTheme.h:
2124         * rendering/RenderThemeGtk.cpp:
2125         (WebCore::RenderThemeGtk::platformInactiveListBoxSelectionBackgroundColor const):
2126         * rendering/RenderThemeGtk.h:
2127         * rendering/RenderThemeMac.h:
2128         * rendering/RenderThemeMac.mm:
2129         (WebCore::RenderThemeMac::documentViewFor const):
2130         (WebCore::RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor const):
2131         (WebCore::RenderThemeMac::systemColor const):
2132         (WebCore::RenderThemeMac::paintCellAndSetFocusedElementNeedsRepaintIfNecessary):
2133         (WebCore::RenderThemeMac::paintSliderThumb):
2134
2135 2018-05-09  Yacine Bandou  <yacine.bandou_ext@softathome.com>
2136
2137         [EME][GStreamer] Crash when the mediaKeys are created before loading the media in debug conf
2138         https://bugs.webkit.org/show_bug.cgi?id=185244
2139
2140         Reviewed by Xabier Rodriguez-Calvar.
2141
2142         The function "MediaPlayerPrivateGStreamerBase::cdmInstanceAttached" is expected to be called once,
2143         so there is an ASSERT(!m_cdmInstance).
2144         But when the MediaKeys are created before loading the media, the cdminstance is created and attached
2145         to the MediaPlayerPrivate via "MediaPlayerPrivateGStreamerBase::cdmInstanceAttached" before loading
2146         the media, then when the media is loading, the function "MediaPlayerPrivateGStreamerBase::cdmInstanceAttached"
2147         will be called several times via the function "mediaEngineWasUpdated" wich is called for each change
2148         in the MediaElement state, thus the WebProcess crashes in the ASSERT(!m_cdmInstance).
2149
2150         This commit avoid the crash by replacing the assert with a simple check.
2151
2152         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2153         (WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceAttached):
2154         (WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceDetached):
2155
2156 2018-05-09  Antti Koivisto  <antti@apple.com>
2157
2158         Add OptionSet::operator& and operator bool
2159         https://bugs.webkit.org/show_bug.cgi?id=185306
2160
2161         Reviewed by Anders Carlsson.
2162
2163         Use it in a few places.
2164
2165         * loader/FrameLoader.cpp:
2166         (WebCore::FrameLoader::reload):
2167         * rendering/RenderLayerCompositor.cpp:
2168         (WebCore::RenderLayerCompositor::logReasonsForCompositing):
2169         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
2170
2171 2018-05-08  Dean Jackson  <dino@apple.com>
2172
2173         Disable system preview link fetching
2174         https://bugs.webkit.org/show_bug.cgi?id=185463
2175
2176         Reviewed by Jon Lee.
2177
2178         Temporarily disable system preview detection when a link
2179         is clicked.
2180
2181         * html/HTMLAnchorElement.cpp:
2182         (WebCore::HTMLAnchorElement::handleClick):
2183
2184 2018-05-08  Wenson Hsieh  <wenson_hsieh@apple.com>
2185
2186         Unreviewed, fix the internal iOS build
2187
2188         Add a missing import statement in an implementation file.
2189
2190         * editing/cocoa/WebContentReaderCocoa.mm:
2191
2192 2018-05-08  Ryan Haddad  <ryanhaddad@apple.com>
2193
2194         Unreviewed, rolling out r231486.
2195
2196         Caused service worker LayoutTest failures on macOS Debug WK2.
2197
2198         Reverted changeset:
2199
2200         "Allow WebResourceLoader to cancel a load served from a
2201         service worker"
2202         https://bugs.webkit.org/show_bug.cgi?id=185274
2203         https://trac.webkit.org/changeset/231486
2204
2205 2018-05-08  Wenson Hsieh  <wenson_hsieh@apple.com>
2206
2207         Consolidate WebContentReaderIOS and WebContentReaderMac into WebContentReaderCocoa
2208         https://bugs.webkit.org/show_bug.cgi?id=185340
2209
2210         Reviewed by Tim Horton.
2211
2212         WebContentReader::readURL is currently the only method implemented separately in iOS and macOS platform
2213         WebContentReader files. The implementation across macOS and iOS is nearly identical (with some exceptions with
2214         the way iOS handles file URLs and plain text editing), so we can merge these into a single method
2215         WebContentReaderCocoa and delete WebContentReaderIOS and WebContentReaderMac.
2216
2217         This also has the added bonus of fixing a latent bug in WebContentReaderMac, wherein URLs written to the
2218         pasteboard using -[NSPasteboard writeObjects:] are currently pasted as empty anchor elements. In this case, the
2219         link title isn't made explicit, so the `title` passed in to WebContentReader::readURL is empty. On iOS, we have
2220         code to fall back to pasting the absolute string of the URL if the title is empty, but on macOS, we'll just use
2221         this empty string as the title of the anchor.
2222
2223         Test: PasteMixedContent.PasteURLWrittenToPasteboardUsingWriteObjects
2224
2225         * SourcesCocoa.txt:
2226         * WebCore.xcodeproj/project.pbxproj:
2227         * editing/cocoa/WebContentReaderCocoa.mm:
2228         (WebCore::WebContentReader::readURL):
2229         * editing/ios/WebContentReaderIOS.mm: Removed.
2230         * editing/mac/WebContentReaderMac.mm: Removed.
2231
2232 2018-05-08  Zalan Bujtas  <zalan@apple.com>
2233
2234         [Simple line layout] Cache run resolver.
2235         https://bugs.webkit.org/show_bug.cgi?id=185411
2236
2237         Reviewed by Antti Koivisto.
2238
2239         This patch caches the run resolver on the [SimpleLine]Layout object. 
2240         In certain cases, when the block container has thousands of elements (foobar1<br>foobar2<br>.....foobar9999<br>),
2241         constructing the resolver (and its dependencies) in a repeating fashion could hang the WebProcess.
2242
2243         Covered by existing tests.
2244
2245         * rendering/SimpleLineLayout.cpp:
2246         (WebCore::SimpleLineLayout::create):
2247         (WebCore::SimpleLineLayout::Layout::create):
2248         (WebCore::SimpleLineLayout::Layout::Layout):
2249         * rendering/SimpleLineLayout.h:
2250         (WebCore::SimpleLineLayout::Layout::runResolver const):
2251         * rendering/SimpleLineLayoutFunctions.cpp:
2252         (WebCore::SimpleLineLayout::paintFlow):
2253         (WebCore::SimpleLineLayout::hitTestFlow):
2254         (WebCore::SimpleLineLayout::collectFlowOverflow):
2255         (WebCore::SimpleLineLayout::computeBoundingBox):
2256         (WebCore::SimpleLineLayout::computeFirstRunLocation):
2257         (WebCore::SimpleLineLayout::collectAbsoluteRects):
2258         (WebCore::SimpleLineLayout::collectAbsoluteQuads):
2259         (WebCore::SimpleLineLayout::textOffsetForPoint):
2260         (WebCore::SimpleLineLayout::collectAbsoluteQuadsForRange):
2261         (WebCore::SimpleLineLayout::generateLineBoxTree):
2262         * rendering/SimpleLineLayoutResolver.cpp:
2263         (WebCore::SimpleLineLayout::LineResolver::LineResolver):
2264         * rendering/SimpleLineLayoutResolver.h:
2265         (WebCore::SimpleLineLayout::lineResolver):
2266
2267 2018-05-08  Brent Fulgham  <bfulgham@apple.com>
2268
2269         Switch some RELEASE_ASSERTS to plain debug ASSERTS in PlatformScreenMac.mm
2270         https://bugs.webkit.org/show_bug.cgi?id=185451
2271         <rdar://problem/39620348>
2272
2273         Reviewed by Zalan Bujtas.
2274
2275         Change a set of RELEASE_ASSERTS used to prevent accessing NSScreen related functions in the
2276         PlatformScreenMac implementation to less expensive Debug ASSERTS.
2277
2278         No change in behavior.
2279
2280         * platform/mac/PlatformScreenMac.mm:
2281         (WebCore::screenHasInvertedColors):
2282         (WebCore::screenDepth):
2283         (WebCore::screenDepthPerComponent):
2284         (WebCore::screenRectForDisplay):
2285         (WebCore::screenRect):
2286         (WebCore::screenAvailableRect):
2287         (WebCore::screenColorSpace):
2288         (WebCore::screenSupportsExtendedColor):
2289
2290 2018-05-08  Daniel Bates  <dabates@apple.com>
2291
2292         Resign Strong Password appearance when text field value changes
2293         https://bugs.webkit.org/show_bug.cgi?id=185433
2294         <rdar://problem/39958508>
2295
2296         Reviewed by Ryosuke Niwa.
2297
2298         Remove the Strong Password decoration when the text field's value changes to avoid interfering
2299         with web sites that allow a person to clear the password field.
2300
2301         Tests: fast/forms/auto-fill-button/auto-fill-strong-password-button-when-maxlength-changes.html
2302                fast/forms/auto-fill-button/auto-fill-strong-password-button-when-minlength-changes.html
2303                fast/forms/auto-fill-button/hide-auto-fill-strong-password-button-when-value-changes.html
2304
2305         * html/HTMLInputElement.cpp:
2306         (WebCore::HTMLInputElement::resignStrongPasswordAppearance): Extracted from HTMLInputElement::updateType().
2307         (WebCore::HTMLInputElement::updateType): Extract out logic to resign the Strong Password appearance
2308         into a function that can be shared by this function and HTMLInputElement::setValue().
2309         (WebCore::HTMLInputElement::setValue): Resign the Strong Password appearance if this field was
2310         changed programmatically (i.e. no DOM change event was dispatched).
2311         * html/HTMLInputElement.h:
2312
2313 2018-05-08  Jer Noble  <jer.noble@apple.com>
2314
2315         Unreviewed build fix; add missing function definition.
2316
2317         * html/HTMLMediaElement.h:
2318         (WebCore::HTMLMediaElement::didPassCORSAccessCheck const):
2319
2320 2018-05-08  Jer Noble  <jer.noble@apple.com>
2321
2322         Mute MediaElementSourceNode when tainted.
2323         https://bugs.webkit.org/show_bug.cgi?id=184866
2324
2325         Reviewed by Eric Carlson.
2326
2327         Test: http/tests/security/webaudio-render-remote-audio-blocked-no-crossorigin.html
2328
2329         * Modules/webaudio/AudioContext.cpp:
2330         (WebCore::AudioContext::wouldTaintOrigin const):
2331         * Modules/webaudio/AudioContext.h:
2332         * Modules/webaudio/MediaElementAudioSourceNode.cpp:
2333         (WebCore::MediaElementAudioSourceNode::setFormat):
2334         (WebCore::MediaElementAudioSourceNode::wouldTaintOrigin):
2335         (WebCore::MediaElementAudioSourceNode::process):
2336         * Modules/webaudio/MediaElementAudioSourceNode.h:
2337
2338 2018-05-08  Eric Carlson  <eric.carlson@apple.com>
2339
2340         Log rtcstats as JSON
2341         https://bugs.webkit.org/show_bug.cgi?id=185437
2342         <rdar://problem/40065332>
2343
2344         Reviewed by Youenn Fablet.
2345
2346         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2347         (WebCore::RTCStatsLogger::RTCStatsLogger): Create a wrapper class so we don't have to add a
2348         toJSONString method to libwebrtc.
2349         (WebCore::RTCStatsLogger::toJSONString const): Log stats as JSON.
2350         (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered): Don't use the LOGIDENTIFIER macro because
2351         it doesn't work well inside of a lambda.
2352         (WTF::LogArgument<WebCore::RTCStatsLogger>::toString): Move into .cpp file because it is only
2353         used here.
2354         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
2355         (WTF::LogArgument<webrtc::RTCStats>::toString): Deleted. Move to .cpp file.
2356
2357 2018-05-08  Dean Jackson  <dino@apple.com>
2358
2359         System Preview links should trigger a download
2360         https://bugs.webkit.org/show_bug.cgi?id=185439
2361         <rdar://problem/40065545>
2362
2363         Reviewed by Jon Lee.
2364
2365         Add a new field to FrameLoadRequest, which then is copied
2366         into ResourceRequest, identifying if the link clicked
2367         is a system preview.
2368
2369         * html/HTMLAnchorElement.cpp:
2370         (WebCore::HTMLAnchorElement::handleClick): Look for isSystemPreviewLink().
2371         * loader/FrameLoadRequest.cpp:
2372         (WebCore::FrameLoadRequest::FrameLoadRequest):
2373         * loader/FrameLoadRequest.h: New property.
2374         (WebCore::FrameLoadRequest::FrameLoadRequest):
2375         (WebCore::FrameLoadRequest::isSystemPreview const):
2376         * loader/FrameLoader.cpp:
2377         (WebCore::FrameLoader::urlSelected):
2378         (WebCore::FrameLoader::loadURL):
2379         * loader/FrameLoader.h:
2380         * platform/network/ResourceRequestBase.cpp:
2381         (WebCore::ResourceRequestBase::isSystemPreview const):
2382         (WebCore::ResourceRequestBase::setSystemPreview):
2383         * platform/network/ResourceRequestBase.h:
2384
2385 2018-05-08  Commit Queue  <commit-queue@webkit.org>
2386
2387         Unreviewed, rolling out r231491.
2388         https://bugs.webkit.org/show_bug.cgi?id=185434
2389
2390         Setting the Created key on a cookie does not work yet, due a
2391         bug in CFNetwork (Requested by ggaren on #webkit).
2392
2393         Reverted changeset:
2394
2395         "[WKHTTPCookieStore getAllCookies] returns inconsistent
2396         creation time"
2397         https://bugs.webkit.org/show_bug.cgi?id=185041
2398         https://trac.webkit.org/changeset/231491
2399
2400 2018-05-08  Sihui Liu  <sihui_liu@apple.com>
2401
2402         [WKHTTPCookieStore getAllCookies] returns inconsistent creation time
2403         https://bugs.webkit.org/show_bug.cgi?id=185041
2404         <rdar://problem/34684214>
2405
2406         Reviewed by Geoffrey Garen.
2407
2408         Set creationtime property when creating Cookie object to keep consistency after conversion.
2409
2410         New API test: WebKit.WKHTTPCookieStoreCreationTime.
2411
2412         * platform/network/cocoa/CookieCocoa.mm:
2413         (WebCore::Cookie::operator NSHTTPCookie * const):
2414
2415 2018-05-08  Eric Carlson  <eric.carlson@apple.com>
2416
2417         Text track cue logging should include cue text
2418         https://bugs.webkit.org/show_bug.cgi?id=185353
2419         <rdar://problem/40003565>
2420
2421         Reviewed by Brent Fulgham.
2422
2423         No new tests, tested manually.
2424
2425         * html/track/VTTCue.cpp:
2426         (WebCore::VTTCue::toJSON const):
2427         * platform/graphics/InbandTextTrackPrivateClient.h:
2428         (WebCore::GenericCueData::toJSONString const):
2429         * platform/graphics/iso/ISOVTTCue.cpp:
2430         (WebCore::ISOWebVTTCue::toJSONString const):
2431
2432 2018-05-08  Sam Weinig  <sam@webkit.org>
2433
2434         More cleanup of XMLHttpRequestUpload
2435         https://bugs.webkit.org/show_bug.cgi?id=185409
2436
2437         Reviewed by Alex Christensen.
2438
2439         - Remove unneeded #includes
2440         - Rename m_xmlHttpRequest to m_request
2441         - Make some overloaded some methods private, and mark them as final rather
2442           than override.
2443
2444         * xml/XMLHttpRequestUpload.cpp:
2445         (WebCore::XMLHttpRequestUpload::XMLHttpRequestUpload):
2446         * xml/XMLHttpRequestUpload.h:
2447
2448 2018-05-08  Zalan Bujtas  <zalan@apple.com>
2449
2450         [LFC] Start using BlockMarginCollapse
2451         https://bugs.webkit.org/show_bug.cgi?id=185424
2452
2453         Reviewed by Antti Koivisto.
2454
2455         BlockMarginCollapse could be all static.
2456
2457         * layout/blockformatting/BlockFormattingContext.cpp:
2458         (WebCore::Layout::BlockFormattingContext::marginTop const):
2459         (WebCore::Layout::BlockFormattingContext::marginBottom const):
2460         * layout/blockformatting/BlockMarginCollapse.cpp:
2461         (WebCore::Layout::isMarginTopCollapsedWithSibling):
2462         (WebCore::Layout::isMarginBottomCollapsedWithSibling):
2463         (WebCore::Layout::isMarginTopCollapsedWithParent):
2464         (WebCore::Layout::isMarginBottomCollapsedWithParent):
2465         (WebCore::Layout::collapsedMarginTopFromFirstChild):
2466         (WebCore::Layout::collapsedMarginBottomFromLastChild):
2467         (WebCore::Layout::nonCollapsedMarginTop):
2468         (WebCore::Layout::nonCollapsedMarginBottom):
2469         (WebCore::Layout::BlockMarginCollapse::marginTop):
2470         (WebCore::Layout::BlockMarginCollapse::marginBottom):
2471         (WebCore::Layout::BlockMarginCollapse::BlockMarginCollapse): Deleted.
2472         (WebCore::Layout::BlockMarginCollapse::marginTop const): Deleted.
2473         (WebCore::Layout::BlockMarginCollapse::marginBottom const): Deleted.
2474         (WebCore::Layout::BlockMarginCollapse::isMarginTopCollapsedWithSibling const): Deleted.
2475         (WebCore::Layout::BlockMarginCollapse::isMarginBottomCollapsedWithSibling const): Deleted.
2476         (WebCore::Layout::BlockMarginCollapse::isMarginTopCollapsedWithParent const): Deleted.
2477         (WebCore::Layout::BlockMarginCollapse::isMarginBottomCollapsedWithParent const): Deleted.
2478         (WebCore::Layout::BlockMarginCollapse::nonCollapsedMarginTop const): Deleted.
2479         (WebCore::Layout::BlockMarginCollapse::nonCollapsedMarginBottom const): Deleted.
2480         (WebCore::Layout::BlockMarginCollapse::collapsedMarginTopFromFirstChild const): Deleted.
2481         (WebCore::Layout::BlockMarginCollapse::collapsedMarginBottomFromLastChild const): Deleted.
2482         (WebCore::Layout::BlockMarginCollapse::hasAdjoiningMarginTopAndBottom const): Deleted.
2483         * layout/blockformatting/BlockMarginCollapse.h:
2484
2485 2018-05-08  Youenn Fablet  <youenn@apple.com>
2486
2487         Allow WebResourceLoader to cancel a load served from a service worker
2488         https://bugs.webkit.org/show_bug.cgi?id=185274
2489
2490         Reviewed by Chris Dumez.
2491
2492         Add support for cancelling a fetch from WebProcess to service worker process.
2493         Use FetchIdentifier instead of uint64_t.
2494
2495         * Modules/fetch/FetchIdentifier.h: Added.
2496         * WebCore.xcodeproj/project.pbxproj:
2497         * workers/service/context/ServiceWorkerFetch.h:
2498         * workers/service/context/ServiceWorkerThreadProxy.cpp:
2499         (WebCore::ServiceWorkerThreadProxy::startFetch):
2500         (WebCore::ServiceWorkerThreadProxy::cancelFetch):
2501         * workers/service/context/ServiceWorkerThreadProxy.h:
2502
2503 2018-05-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
2504
2505         feTurbulence is not rendered correctly on Retina display
2506         https://bugs.webkit.org/show_bug.cgi?id=183798
2507
2508         Reviewed by Simon Fraser.
2509
2510         On 2x display the feTurbulence filter creates a scaled ImageBuffer but
2511         processes only the unscaled size. This is a remaining work of r168577 and
2512         is very similar to what was done for the feMorphology filter in r188271.
2513
2514         Test: fast/hidpi/filters-turbulence.html
2515
2516         * platform/graphics/filters/FETurbulence.cpp:
2517         (WebCore::FETurbulence::fillRegion const):
2518         (WebCore::FETurbulence::platformApplySoftware):
2519
2520 2018-05-07  Zalan Bujtas  <zalan@apple.com>
2521
2522         [LFC] Add FormattingContext::layoutOutOfFlowDescendants implementation
2523         https://bugs.webkit.org/show_bug.cgi?id=185377
2524
2525         Reviewed by Antti Koivisto.
2526
2527         Also, remove FormattingContext's m_layoutContext member and pass it in to ::layout() instead.
2528         In theory LayoutContext is needed only during ::layout() call. 
2529
2530         * layout/FormattingContext.cpp:
2531         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
2532         * layout/FormattingContext.h:
2533         (WebCore::Layout::FormattingContext::layoutContext const):
2534         * layout/LayoutContext.cpp:
2535         (WebCore::Layout::LayoutContext::updateLayout):
2536         * layout/blockformatting/BlockFormattingContext.cpp:
2537         (WebCore::Layout::BlockFormattingContext::layout const):
2538         * layout/blockformatting/BlockFormattingContext.h:
2539         * layout/inlineformatting/InlineFormattingContext.cpp:
2540         (WebCore::Layout::InlineFormattingContext::layout const):
2541         * layout/inlineformatting/InlineFormattingContext.h:
2542
2543 2018-05-07  Daniel Bates  <dabates@apple.com>
2544
2545         Check X-Frame-Options and CSP frame-ancestors in network process
2546         https://bugs.webkit.org/show_bug.cgi?id=185410
2547         <rdar://problem/37733934>
2548
2549         Reviewed by Ryosuke Niwa.
2550
2551         * WebCore.xcodeproj/project.pbxproj: Make PingLoader.h a private header so that we can include it in WebKit.
2552         * loader/DocumentLoader.cpp:
2553         (WebCore::DocumentLoader::responseReceived): Only check CSP frame-ancestors and X-Frame-Options here if
2554         we are not checking them in the NetworkProcess and HTTP response access is restricted. I code is otherwise kept
2555         unchanged. There may be opportunities to clean this code up more and share more of it. We should look into this
2556         in subsequent bugs.
2557         * loader/DocumentLoader.h: Change visibility of stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied() from
2558         private to public and export it so that we can call it from the WebKit.
2559         * loader/PingLoader.h:
2560         * page/Settings.yaml: Add a new setting called networkProcessCSPFrameAncestorsCheckingEnabled (defaults: false)
2561         and is hardcoded in WebPage.cpp to be enabled. This setting is used to determine if we will be using the NetworkProcess.
2562         Ideally we wouldn't have this setting and just key off RuntimeEnabledFeatures::sharedFeatures().restrictedHTTPResponseAccess().
2563         However RuntimeEnabledFeatures::sharedFeatures().restrictedHTTPResponseAccess() is always enabled in WebKit Legacy
2564         at the time of writing (why?). And, strangely, RuntimeEnabledFeatures::sharedFeatures().restrictedHTTPResponseAccess()
2565         is conditionally enabled in WebKit. For now, we add a new setting, networkProcessCSPFrameAncestorsCheckingEnabled,
2566         to determine if CSP checking should be performed in NetworkProcess. For checking to actually happen in NetworkProcess
2567         and not in DocumentLoader::responseReceived() RuntimeEnabledFeatures::sharedFeatures().restrictedHTTPResponseAccess()
2568         will also need to be enabled.
2569         * page/csp/ContentSecurityPolicy.cpp:
2570         (WebCore::ContentSecurityPolicy::allowFrameAncestors const): Added a variant that takes a vector of ancestor origins.
2571         * page/csp/ContentSecurityPolicy.h:
2572         * page/csp/ContentSecurityPolicyDirectiveList.cpp:
2573         (WebCore::checkFrameAncestors): Ditto.
2574         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForFrameAncestorOrigins const): Ditto.
2575         * page/csp/ContentSecurityPolicyDirectiveList.h: Export constructor so that we can invoke it from NetworkResourceLoader::shouldInterruptLoadForCSPFrameAncestorsOrXFrameOptions().
2576         * page/csp/ContentSecurityPolicyResponseHeaders.h:
2577         * platform/network/HTTPParsers.h: Export XFrameOptionsDisposition() so that we can use in WebKit.
2578
2579 2018-05-07  Daniel Bates  <dabates@apple.com>
2580
2581         Abstract logic to log console messages and send CSP violation reports into a client
2582         https://bugs.webkit.org/show_bug.cgi?id=185393
2583         <rdar://problem/40036053>
2584
2585         Reviewed by Brent Fulgham.
2586
2587         First pass at adding infrastructure to supporting CSP reporting from NetworkProcess and workers.
2588         Replaces the existing ContentSecurityPolicy constructor that takes a Frame with one that
2589         takes a ContentSecurityPolicyClient to delegate to for logging and sending reports. We will look
2590         to remove ContentSecurityPolicy constructor that takes a ScriptExecutionContext in a follow up.
2591
2592         Standardize on instantiating a ContentSecurityPolicy with the full URL to resource that it protects
2593         instead of taking only the SecurityOrigin of this URL. By taking the full URL the ContentSecurityPolicy
2594         object is now capable of resolving a relative report URL without needing a Document/ScriptExecutionContext.
2595
2596         We are underutilizing the CSPInfo struct and ContentSecurityPolicyClient::willSendCSPViolationReport()
2597         delegate callback in this patch. We will make use of this functionality in a subsequent patch to
2598         support collecting script state (e.g. source line number) when reporting CSP violations in worker
2599         threads. We also no longer go through the unnecessary motions to try to collect script state for a
2600         frame-ancestors violation (since DocumentLoader extends ContentSecurityPolicyClient and does not
2601         implement ContentSecurityPolicyClient::willSendCSPViolationReport()). The frame-ancestors directive
2602         is checked before a document is parsed and executes script; => there will never be any script state
2603         to collect; => it is not necessary to try to collect it as we currently do.
2604
2605         * Sources.txt: Add file ContentSecurityPolicyClient.cpp. See the remarks for ContentSecurityPolicyClient.cpp
2606         below on why we have this file.
2607         * WebCore.xcodeproj/project.pbxproj: Add files ContentSecurityPolicyClient.{h, cpp}.
2608         * dom/Document.cpp:
2609         (WebCore::Document::initSecurityContext): Pass the URL of the protected document.
2610         * loader/DocumentLoader.cpp:
2611         (WebCore::DocumentLoader::responseReceived): Ditto.
2612         (WebCore::DocumentLoader::addConsoleMessage): Added.
2613         (WebCore::DocumentLoader::sendCSPViolationReport): Added.
2614         (WebCore::DocumentLoader::dispatchSecurityPolicyViolationEvent): Added.
2615         * loader/DocumentLoader.h:
2616         * loader/FrameLoaderClient.h: Fix typo in comment.
2617         * loader/WorkerThreadableLoader.cpp:
2618         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge): Pass the URL of the worker script.
2619         * page/csp/ContentSecurityPolicy.cpp:
2620         (WebCore::ContentSecurityPolicy::ContentSecurityPolicy): Added overload that takes a URL&& and an optional
2621         ContentSecurityPolicyClient*.
2622         (WebCore::ContentSecurityPolicy::deprecatedURLForReporting const): Extracted and simplified stripURLForUseInReport()
2623         into this member function.
2624         (WebCore::ContentSecurityPolicy::reportViolation const): Modified to make use of the client, if we have
2625         one and removed code for handling a ContentSecurityPolicy that was instantiated with a Frame.
2626         (WebCore::ContentSecurityPolicy::logToConsole const): Ditto.
2627         (WebCore::stripURLForUseInReport): Deleted; incorporated into ContentSecurityPolicy::deprecatedURLForReporting().
2628         * page/csp/ContentSecurityPolicy.h:
2629         * page/csp/ContentSecurityPolicyClient.cpp: Added. This file exists so that we can define the virtual
2630         destructor out-of-line and export this abstract class so as to avoid the need for the vtable to be
2631         defined in the translation unit of each derived class.
2632         * page/csp/ContentSecurityPolicyClient.h: Added.
2633         * page/csp/ContentSecurityPolicySource.cpp:
2634         (WebCore::ContentSecurityPolicySource::operator SecurityOriginData const): Added.
2635         * page/csp/ContentSecurityPolicySource.h:
2636         * workers/WorkerGlobalScope.cpp:
2637         (WebCore::WorkerGlobalScope::WorkerGlobalScope): Instantiate the ContentSecurityPolicy object with the
2638         URL of the worker script.
2639
2640 2018-05-07  Simon Fraser  <simon.fraser@apple.com>
2641
2642         CSS filters which reference SVG filters fail to respect the "color-interpolation-filters" of the filter
2643         https://bugs.webkit.org/show_bug.cgi?id=185343
2644
2645         Reviewed by Dean Jackson.
2646
2647         Test: css3/filters/color-interpolation-filters.html
2648         
2649         When applying CSS reference filters, apply the value of "color-interpolation-filters" for the
2650         referenced filter effect element, just as we do for SVG filters.
2651
2652         * rendering/FilterEffectRenderer.cpp:
2653         (WebCore::FilterEffectRenderer::buildReferenceFilter):
2654
2655 2018-05-07  Daniel Bates  <dabates@apple.com>
2656
2657         CSP status-code incorrect for document blocked due to violation of its frame-ancestors directive
2658         https://bugs.webkit.org/show_bug.cgi?id=185366
2659         <rdar://problem/40035116>
2660
2661         Reviewed by Brent Fulgham.
2662
2663         Fixes an issue where the status-code in the sent CSP report for an HTTP document blocked because
2664         its frame-ancestors directive was violated would be the status code of the previously loaded
2665         document in the frame. If the previously loaded document was about:blank then this would be 0.
2666
2667         Currently whenever we send a CSP report we ask the document's loader (Document::loader()) for the
2668         HTTP status code for the last response. Document::loader() returns the loader for the last committed
2669         document its frame. For a frame-ancestors violation, a CSP report is sent before the document
2670         that had the frame-ancestors directive has been committed and after it has been associate with a frame.
2671         As a result we are in are in a transient transition state for the frame and hence the last response
2672         for new document's loader (Document::loader()) is actually the last response of the previously loaded
2673         document in the frame. Instead we need to take care to tell CSP about the HTTP status code for the
2674         response associated with the document the CSP came from.
2675
2676         * dom/Document.cpp:
2677         (WebCore::Document::processHttpEquiv):
2678         (WebCore::Document::initSecurityContext):
2679         Pass the HTTP status code to CSP.
2680
2681         * page/csp/ContentSecurityPolicy.cpp:
2682         (WebCore::ContentSecurityPolicy::copyStateFrom):
2683         (WebCore::ContentSecurityPolicy::responseHeaders const):
2684         (WebCore::ContentSecurityPolicy::didReceiveHeaders):
2685         (WebCore::ContentSecurityPolicy::didReceiveHeader):
2686         (WebCore::ContentSecurityPolicy::reportViolation const):
2687         * page/csp/ContentSecurityPolicy.h:
2688         Modify existing functions to take the HTTP status code, store it in a instance variable,
2689         and reference this variable when reporting a violation.
2690
2691         * page/csp/ContentSecurityPolicyResponseHeaders.cpp:
2692         (WebCore::ContentSecurityPolicyResponseHeaders::ContentSecurityPolicyResponseHeaders):
2693         (WebCore::ContentSecurityPolicyResponseHeaders::isolatedCopy const):
2694         * page/csp/ContentSecurityPolicyResponseHeaders.h:
2695         (WebCore::ContentSecurityPolicyResponseHeaders::encode const):
2696         (WebCore::ContentSecurityPolicyResponseHeaders::decode):
2697         Store the HTTP status code along with the response headers.
2698
2699 2018-05-07  Daniel Bates  <dabates@apple.com>
2700
2701         CSP referrer incorrect for document blocked due to violation of its frame-ancestors directive
2702         https://bugs.webkit.org/show_bug.cgi?id=185380
2703
2704         Reviewed by Brent Fulgham.
2705
2706         Similar to <https://bugs.webkit.org/show_bug.cgi?id=185366>, fixes an issue where the referrer
2707         in the sent CSP report for an HTTP document blocked because its frame-ancestors directive was
2708         violated would be the referrer of the previously loaded document in the frame.
2709
2710         Currently whenever we send a CSP report we ask the document's loader (Document::loader()) for
2711         the referrer for the last request. Document::loader() returns the loader for the last committed
2712         document in its frame. For a frame-ancestors violation, a CSP report is sent before the document
2713         that had the frame-ancestors directive has been committed and after it has been associate with a
2714         frame. As a result we are in a transient transition state for the frame and hence the last request
2715         for the new document's loader (Document::loader()) is actually the last request of the previously
2716         loaded document in the frame. Instead we need to take care to tell CSP about the referrer for the
2717         request associated with the document the CSP came from.
2718
2719         * loader/DocumentLoader.cpp:
2720         (WebCore::DocumentLoader::responseReceived):
2721
2722 2018-05-07  Brent Fulgham  <bfulgham@apple.com>
2723
2724         Add experimental feature to prompt for Storage Access API use
2725         https://bugs.webkit.org/show_bug.cgi?id=185335
2726         <rdar://problem/39994649>
2727
2728         Reviewed by Alex Christensen and Youenn Fablet.
2729
2730         Create a new experimental feature that gates the ability of WebKit clients to prompt the user when
2731         Storage Access API is invoked.
2732
2733         Currently this feature doesn't have any user-visible impact.
2734
2735         * page/RuntimeEnabledFeatures.h:
2736         (WebCore::RuntimeEnabledFeatures::setStorageAccessPromptsEnabled):
2737         (WebCore::RuntimeEnabledFeatures::storageAccessPromptsEnabled const):
2738         * testing/InternalSettings.cpp:
2739         (WebCore::InternalSettings::Backup::Backup):
2740         (WebCore::InternalSettings::Backup::restoreTo):
2741         (WebCore::InternalSettings::setStorageAccessPromptsEnabled):
2742         * testing/InternalSettings.h:
2743         * testing/InternalSettings.idl:
2744
2745 2018-05-07  Chris Dumez  <cdumez@apple.com>
2746
2747         Stop using an iframe's id as fallback if its name attribute is not set
2748         https://bugs.webkit.org/show_bug.cgi?id=11388
2749
2750         Reviewed by Geoff Garen.
2751
2752         WebKit had logic to use an iframe's id as fallback name when its name
2753         content attribute is not set. This behavior was not standard and did not
2754         match other browsers:
2755         - https://html.spec.whatwg.org/#attr-iframe-name
2756
2757         Gecko / Trident never behaved this way. Blink was aligned with us until
2758         they started to match the specification in:
2759         - https://bugs.chromium.org/p/chromium/issues/detail?id=347169
2760
2761         This WebKit quirk was causing some Web-compatibility issues because it
2762         would affect the behavior of Window's name property getter when trying
2763         to look up an iframe by id. Because of Window's named property getter
2764         behavior [1], we would return the frame's contentWindow instead of the
2765         iframe element itself.
2766
2767         [1] https://html.spec.whatwg.org/multipage/window-object.html#named-access-on-the-window-object
2768
2769         Test: fast/dom/Window/named-getter-frame-id.html
2770
2771         * html/HTMLFrameElementBase.cpp:
2772         (WebCore::HTMLFrameElementBase::openURL):
2773         (WebCore::HTMLFrameElementBase::parseAttribute):
2774         (WebCore::HTMLFrameElementBase::didFinishInsertingNode):
2775         * html/HTMLFrameElementBase.h:
2776
2777 2018-05-07  Chris Dumez  <cdumez@apple.com>
2778
2779         ASSERT(!childItemWithTarget(child->target())) is hit in HistoryItem::addChildItem()
2780         https://bugs.webkit.org/show_bug.cgi?id=185322
2781
2782         Reviewed by Geoff Garen.
2783
2784         We generate unique names for Frame to be used in HistoryItem. Those names not only
2785         need to be unique, they also need to be repeatable to avoid layout tests flakiness
2786         and for things like restoring form state from a HistoryItem.
2787
2788         The previously generated frame names were relying on the Frame's index among a
2789         parent Frame's children. The issue was that we could end up with duplicate names
2790         because one could insert a Frame *before* an existing one. This is because the code
2791         would not take care of updating existing Frames' unique name on frame tree mutation.
2792
2793         Updating frame tree names on mutation would be inefficient and is also not necessary.
2794         The approach chosen in this patch is to stop using the Frame's index and instead rely
2795         on an increasing counter stored on the top-frame's FrameTree. To make the names
2796         repeatable, we reset the counter on page navigation.
2797
2798         * page/Frame.cpp:
2799         (WebCore::Frame::setDocument):
2800         * page/FrameTree.cpp:
2801         (WebCore::FrameTree::uniqueChildName const):
2802         (WebCore::FrameTree::generateUniqueName const):
2803         * page/FrameTree.h:
2804         (WebCore::FrameTree::resetFrameIdentifiers):
2805
2806 2018-05-07  Yacine Bandou  <yacine.bandou_ext@softathome.com>
2807
2808         [EME][GStreamer] Fix wrong subsample parsing on r227067
2809         https://bugs.webkit.org/show_bug.cgi?id=185382
2810
2811         Reviewed by Philippe Normand.
2812
2813         The initialization of sampleIndex should be moved outside of the loop.
2814         Without this patch we will have a bad log and the check of the subsample
2815         count will be useless.
2816
2817         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
2818         (webKitMediaClearKeyDecryptorDecrypt):
2819
2820 2018-05-07  Daniel Bates  <dabates@apple.com>
2821
2822         CSP should be passed the referrer
2823         https://bugs.webkit.org/show_bug.cgi?id=185367
2824
2825         Reviewed by Per Arne Vollan.
2826
2827         As a step towards formalizing a CSP delegate object and removing the dependencies
2828         on ScriptExecutionContext and Frame, we should pass the document's referrer directly
2829         instead of indirectly obtaining it from the ScriptExecutionContext or Frame used
2830         to instantiate the ContentSecurityPolicy object.
2831
2832         * dom/Document.cpp:
2833         (WebCore::Document::processHttpEquiv): Pass the document's referrer.
2834         (WebCore::Document::initSecurityContext): Ditto.
2835         (WebCore::Document::applyQuickLookSandbox): Ditto.
2836         * loader/DocumentLoader.cpp:
2837         (WebCore::DocumentLoader::responseReceived): Ditto.
2838         * loader/FrameLoader.cpp:
2839         (WebCore::FrameLoader::didBeginDocument): Ditto.
2840         * page/csp/ContentSecurityPolicy.cpp:
2841         (WebCore::ContentSecurityPolicy::copyStateFrom): We pass a null string for the referrer
2842         to didReceiveHeader() as a placeholder since it requires the referrer be given to it. We
2843         fix up the referrer (m_referrer) after copying all the policy headers.
2844         (WebCore::ContentSecurityPolicy::didReceiveHeaders): Ditto.
2845         (WebCore::ContentSecurityPolicy::didReceiveHeader): Modified to take a referrer and WTFMove()s
2846         it into an instance variable (m_referrer).
2847         (WebCore::ContentSecurityPolicy::reportViolation const): Modified to use the stored referrer.
2848         * page/csp/ContentSecurityPolicy.h:
2849         * workers/WorkerGlobalScope.cpp:
2850         (WebCore::WorkerGlobalScope::applyContentSecurityPolicyResponseHeaders): Pass a null string
2851         for the referrer as a worker does not have a referrer.
2852
2853 2018-05-07  Daniel Bates  <dabates@apple.com>
2854
2855         CSP should only notify Inspector to pause the debugger on the first policy to violate a directive
2856         https://bugs.webkit.org/show_bug.cgi?id=185364
2857
2858         Reviewed by Brent Fulgham.
2859
2860         Notify Web Inspector that a script was blocked on the first enforced CSP policy that it
2861         violates.
2862
2863         A page can have more than one enforced Content Security Policy. Currently for inline
2864         scripts, inline event handlers, JavaScript URLs, and eval() that are blocked by CSP
2865         we notify Web Inspector that it was blocked for each CSP policy that blocked it. When
2866         Web Inspector is notified it pauses script execution. It does not seem very meaningful
2867         to pause script execution on the same script for each CSP policy that blocked it.
2868         Therefore, only tell Web Inspector that a script was blocked for the first enforced CSP
2869         policy that blocked it.
2870
2871         * page/csp/ContentSecurityPolicy.cpp:
2872         (WebCore::ContentSecurityPolicy::allowJavaScriptURLs const):
2873         (WebCore::ContentSecurityPolicy::allowInlineEventHandlers const):
2874         (WebCore::ContentSecurityPolicy::allowInlineScript const):
2875         (WebCore::ContentSecurityPolicy::allowEval const):
2876
2877 2018-05-07  Daniel Bates  <dabates@apple.com>
2878
2879         Substitute CrossOriginPreflightResultCache::clear() for CrossOriginPreflightResultCache::empty()
2880         https://bugs.webkit.org/show_bug.cgi?id=185170
2881
2882         Reviewed by Per Arne Vollan.
2883
2884         Rename CrossOriginPreflightResultCache::empty() to CrossOriginPreflightResultCache::clear() make
2885         it consistent with the terminology we use in WebKit to signify a function that clears a collection.
2886         A member function named "empty" is expected to return an instance of a class in its "empty state".
2887         For example, StringImpl::empty() returns a StringImpl instance that represents the empty string.
2888         However CrossOriginPreflightResultCache::empty() clears out the cache in-place. We should rename
2889         this function to better describe its purpose.
2890
2891         * loader/CrossOriginPreflightResultCache.cpp:
2892         (WebCore::CrossOriginPreflightResultCache::clear):
2893         (WebCore::CrossOriginPreflightResultCache::empty): Deleted.
2894         * loader/CrossOriginPreflightResultCache.h:
2895
2896 2018-05-06  Dean Jackson  <dino@apple.com>
2897
2898         WebGL: Reset simulated values after validation fails
2899         https://bugs.webkit.org/show_bug.cgi?id=185363
2900         <rdar://problem/39733417>
2901
2902         Reviewed by Anders Carlsson.
2903
2904         While fixing a previous bug, I forgot to reset some values
2905         when validation fails. This caused a bug where a subsequent
2906         invalid call might use those values and escape detection.
2907
2908         Test: fast/canvas/webgl/index-validation-with-subsequent-draws.html
2909
2910         * html/canvas/WebGLRenderingContextBase.cpp:
2911         (WebCore::WebGLRenderingContextBase::simulateVertexAttrib0): Reset the
2912         sizes when validation fails.
2913         * html/canvas/WebGLRenderingContextBase.h:
2914
2915 2018-05-07  Ms2ger  <Ms2ger@igalia.com>
2916
2917         Support negative sw/sh values in createImageBitmap().
2918         https://bugs.webkit.org/show_bug.cgi?id=184449
2919
2920         Reviewed by Dean Jackson.
2921
2922         Tests: LayoutTests/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage.html
2923                LayoutTests/http/wpt/2dcontext/imagebitmap/createImageBitmap.html
2924
2925         * html/ImageBitmap.cpp:
2926         (WebCore::ImageBitmap::createPromise): handle negative values per spec.
2927
2928 2018-05-07  Brian Burg  <bburg@apple.com>
2929
2930         Web Inspector: opt out of process swap on navigation if a Web Inspector frontend is connected
2931         https://bugs.webkit.org/show_bug.cgi?id=184861
2932         <rdar://problem/39153768>
2933
2934         Reviewed by Timothy Hatcher.
2935
2936         Notify the client of the current connection count whenever a frontend connects or disconnects.
2937
2938         Covered by new API test.
2939
2940         * inspector/InspectorClient.h:
2941         (WebCore::InspectorClient::frontendCountChanged):
2942         * inspector/InspectorController.cpp:
2943         (WebCore::InspectorController::connectFrontend):
2944         (WebCore::InspectorController::disconnectFrontend):
2945         (WebCore::InspectorController::disconnectAllFrontends):
2946         * inspector/InspectorController.h:
2947
2948 2018-05-07  Eric Carlson  <eric.carlson@apple.com>
2949
2950         Text track cue logging should include cue text
2951         https://bugs.webkit.org/show_bug.cgi?id=185353
2952         <rdar://problem/40003565>
2953
2954         Reviewed by Youenn Fablet.
2955
2956         No new tests, tested manually.
2957
2958         * html/track/VTTCue.cpp:
2959         (WebCore::VTTCue::toJSONString const): Use toJSON.
2960         (WebCore::VTTCue::toJSON const): New.
2961         * html/track/VTTCue.h:
2962
2963         * platform/graphics/InbandTextTrackPrivateClient.h:
2964         (WebCore::GenericCueData::toJSONString const): Log m_content.
2965
2966         * platform/graphics/iso/ISOVTTCue.cpp:
2967         (WebCore::ISOWebVTTCue::toJSONString const): Log m_cueText.
2968
2969 2018-05-06  Zalan Bujtas  <zalan@apple.com>
2970
2971         [LFC] Add assertions for stale Display::Box geometry
2972         https://bugs.webkit.org/show_bug.cgi?id=185357
2973
2974         Reviewed by Antti Koivisto.
2975
2976         Ensure that we don't access stale geometry of other boxes during layout.
2977         For example, in order to layout a block child we need the containing block's content box top/left and width (but not the height)
2978
2979         * layout/displaytree/DisplayBox.h:
2980         (WebCore::Display::Box::invalidateTop):
2981         (WebCore::Display::Box::invalidateLeft):
2982         (WebCore::Display::Box::invalidateWidth):
2983         (WebCore::Display::Box::invalidateHeight):
2984         (WebCore::Display::Box::hasValidPosition const):
2985         (WebCore::Display::Box::hasValidSize const):
2986         (WebCore::Display::Box::hasValidGeometry const):
2987         (WebCore::Display::Box::invalidatePosition):
2988         (WebCore::Display::Box::invalidateSize):
2989         (WebCore::Display::Box::setHasValidPosition):
2990         (WebCore::Display::Box::setHasValidSize):
2991         (WebCore::Display::Box::setHasValidGeometry):
2992         (WebCore::Display::Box::rect const):
2993         (WebCore::Display::Box::top const):
2994         (WebCore::Display::Box::left const):
2995         (WebCore::Display::Box::bottom const):
2996         (WebCore::Display::Box::right const):
2997         (WebCore::Display::Box::topLeft const):
2998         (WebCore::Display::Box::bottomRight const):
2999         (WebCore::Display::Box::size const):
3000         (WebCore::Display::Box::width const):
3001         (WebCore::Display::Box::height const):
3002         (WebCore::Display::Box::setRect):
3003         (WebCore::Display::Box::setTopLeft):
3004         (WebCore::Display::Box::setTop):
3005         (WebCore::Display::Box::setLeft):
3006         (WebCore::Display::Box::setSize):
3007         (WebCore::Display::Box::setWidth):
3008         (WebCore::Display::Box::setHeight):
3009
3010 2018-05-06  Zalan Bujtas  <zalan@apple.com>
3011
3012         [LFC] Add BlockFormattingContext::computeStaticPosition
3013         https://bugs.webkit.org/show_bug.cgi?id=185352
3014
3015         Reviewed by Antti Koivisto.
3016
3017         This is the core logic for positioning inflow boxes in a block formatting context (very naive though).
3018
3019         * layout/blockformatting/BlockFormattingContext.cpp:
3020         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
3021         * layout/displaytree/DisplayBox.h:
3022
3023 2018-05-05  Sam Weinig  <sam@webkit.org>
3024
3025         Cleanup XMLHttpRequestUpload a little
3026         https://bugs.webkit.org/show_bug.cgi?id=185344
3027
3028         Reviewed by Yusuke Suzuki.
3029
3030         * bindings/js/JSXMLHttpRequestCustom.cpp:
3031         (WebCore::JSXMLHttpRequest::visitAdditionalChildren):
3032         Use auto to reduce redundancy.
3033
3034         * xml/XMLHttpRequest.cpp:
3035         (WebCore::XMLHttpRequest::upload):
3036         * xml/XMLHttpRequest.h:
3037         Switch upload() to return a reference.
3038         
3039         * xml/XMLHttpRequestUpload.cpp:
3040         (WebCore::XMLHttpRequestUpload::XMLHttpRequestUpload):
3041         (WebCore::XMLHttpRequestUpload::dispatchProgressEvent):
3042         * xml/XMLHttpRequestUpload.h:
3043         Cleanup formatting, modernize and switch XMLHttpRequest member from a pointer
3044         to a reference.
3045
3046 2018-05-05  Dean Jackson  <dino@apple.com>
3047
3048         Draw a drop-shadow behind the system preview badge
3049         https://bugs.webkit.org/show_bug.cgi?id=185356
3050         <rdar://problem/40004936>
3051
3052         Reviewed by Wenson Hsieh.
3053
3054         Draw a very subtle drop-shadow under the system
3055         preview badge so that it is more visible on a pure
3056         white background.
3057
3058         I also moved some code around to make it more clear
3059         and improved comments.
3060
3061         * rendering/RenderThemeIOS.mm:
3062         (WebCore::RenderThemeIOS::paintSystemPreviewBadge):
3063
3064 2018-05-04  Wenson Hsieh  <wenson_hsieh@apple.com>
3065
3066         [iOS] Multiple links in Mail are dropped in a single line, and are difficult to tell apart
3067         https://bugs.webkit.org/show_bug.cgi?id=185289
3068         <rdar://problem/35756912>
3069
3070         Reviewed by Tim Horton and Darin Adler.
3071
3072         When inserting multiple URLs as individual items in a single drop, we currently separate each item with a space
3073         (see r217284). However, it still seems difficult to tell dropped links apart. This patch makes some slight
3074         tweaks to WebContentReader::readURL so that it inserts line breaks before dropped URLs, if the dropped URL isn't
3075         the first item to be inserted in the resulting document fragment.
3076
3077         Augments existing API tests in DataInteractionTests.
3078
3079         * editing/ios/WebContentReaderIOS.mm:
3080
3081         Additionally remove some extraneous header imports from this implementation file.
3082
3083         (WebCore::WebContentReader::readURL):
3084
3085 2018-05-02  Dean Jackson  <dino@apple.com>
3086
3087         Use IOSurfaces for CoreImage operations where possible
3088         https://bugs.webkit.org/show_bug.cgi?id=185230
3089         <rdar://problem/39926929>
3090
3091         Reviewed by Jon Lee.
3092
3093         On iOS hardware, we can use IOSurfaces as a rendering destination
3094         for CoreImage, which means we're keeping data on the GPU
3095         for rendering.
3096
3097         As a drive-by fix, I used a convenience method for Gaussian blurs.
3098
3099         * rendering/RenderThemeIOS.mm:
3100         (WebCore::RenderThemeIOS::paintSystemPreviewBadge):
3101
3102 2018-05-04  Tim Horton  <timothy_horton@apple.com>
3103
3104         Shift to a lower-level framework for simplifying URLs
3105         https://bugs.webkit.org/show_bug.cgi?id=185334
3106
3107         Reviewed by Dan Bernstein.
3108
3109         * Configurations/WebCore.xcconfig:
3110         * platform/mac/DragImageMac.mm:
3111         (WebCore::LinkImageLayout::LinkImageLayout):
3112
3113 2018-05-03  Ryosuke Niwa  <rniwa@webkit.org>
3114
3115         Release assert in ScriptController::canExecuteScripts via HTMLMediaElement::~HTMLMediaElement()
3116         https://bugs.webkit.org/show_bug.cgi?id=185288
3117
3118         Reviewed by Jer Noble.
3119
3120         The crash is caused by HTMLMediaElement::~HTMLMediaElement canceling the resource load via CachedResource
3121         which ends up calling FrameLoader::checkCompleted() and fire load event on the document synchronously.
3122         Speculatively fix the crash by scheduling the check instead.
3123
3124         In long term, ResourceLoader::cancel should never fire load event synchronously: webkit.org/b/185284.
3125
3126         Unfortunately, no new tests since I can't get MediaResource to get destructed at the right time.
3127
3128         * html/HTMLMediaElement.cpp:
3129         (WebCore::HTMLMediaElement::isRunningDestructor): Added to detect this specific case.
3130         (WebCore::HTMLMediaElementDestructorScope): Added.
3131         (WebCore::HTMLMediaElementDestructorScope::HTMLMediaElementDestructorScope): Added.
3132         (WebCore::HTMLMediaElementDestructorScope::~HTMLMediaElementDestructorScope): Added.
3133         (WebCore::HTMLMediaElement::~HTMLMediaElement): Instantiate HTMLMediaElement.
3134         * html/HTMLMediaElement.h:
3135         * loader/FrameLoader.cpp:
3136         (WebCore::FrameLoader::checkCompleted): Call scheduleCheckCompleted instead of synchronously calling
3137         checkCompleted if we're in the middle of destructing a HTMLMediaElement.
3138
3139 2018-05-04  Ryosuke Niwa  <rniwa@webkit.org>
3140
3141         Rename DocumentOrderedMap to TreeScopeOrderedMap
3142         https://bugs.webkit.org/show_bug.cgi?id=185290
3143
3144         Reviewed by Zalan Bujtas.
3145
3146         Renamed the class since it's almost always a mistake to use this class as a member variable of Document.
3147
3148         * Sources.txt:
3149         * WebCore.xcodeproj/project.pbxproj:
3150         * dom/MouseRelatedEvent.cpp: Include the forgotten DOMWindow.h. Unified build files bit us here.
3151         * dom/TreeScope.cpp:
3152         (WebCore::TreeScope::addElementById):
3153         (WebCore::TreeScope::addElementByName):
3154         (WebCore::TreeScope::addImageMap):
3155         (WebCore::TreeScope::addImageElementByUsemap):
3156         (WebCore::TreeScope::labelElementForId):
3157         * dom/TreeScope.h:
3158         * dom/TreeScopeOrderedMap.cpp: Renamed from DocumentOrderedMap.cpp
3159         * dom/TreeScopeOrderedMap.h: Renamed from DocumentOrderedMap.h
3160         * html/HTMLDocument.h:
3161
3162 2018-05-04  Don Olmstead  <don.olmstead@sony.com>
3163
3164         [Win][WebKit] Fix forwarding headers for Windows build
3165         https://bugs.webkit.org/show_bug.cgi?id=184412
3166
3167         Reviewed by Alex Christensen.
3168
3169         No new tests. No change in behavior.
3170
3171         * PlatformWin.cmake:
3172
3173 2018-05-04  Zalan Bujtas  <zalan@apple.com>
3174
3175         [Simple line layout] Add support for line layout box generation with multiple text renderers.
3176         https://bugs.webkit.org/show_bug.cgi?id=185276
3177
3178         Reviewed by Antti Koivisto.
3179
3180         Covered by existing tests.
3181
3182         * rendering/SimpleLineLayoutFunctions.cpp:
3183         (WebCore::SimpleLineLayout::canUseForLineBoxTree):
3184         (WebCore::SimpleLineLayout::generateLineBoxTree):
3185         * rendering/SimpleLineLayoutResolver.cpp:
3186         (WebCore::SimpleLineLayout::RunResolver::Run::renderer const):
3187         (WebCore::SimpleLineLayout::RunResolver::Run::localStart const):
3188         (WebCore::SimpleLineLayout::RunResolver::Run::localEnd const):
3189         * rendering/SimpleLineLayoutResolver.h:
3190
3191 2018-05-04  Timothy Hatcher  <timothy@apple.com>
3192
3193         Deprecate legacy WebView and friends
3194         https://bugs.webkit.org/show_bug.cgi?id=185279
3195         rdar://problem/33268700
3196
3197         Reviewed by Tim Horton.
3198
3199         * Configurations/WebCore.xcconfig:
3200         Added BUILDING_WEBKIT define to disable the deprecation macros.
3201         * bridge/objc/WebScriptObject.h:
3202         Added deprecation macros to WebScriptObject and WebUndefined.
3203         * platform/cocoa/WebKitAvailability.h:
3204         Added more macros and a way to disable deprecation warnings for
3205         WebKit build and in clients like Safari.
3206
3207 2018-05-04  Eric Carlson  <eric.carlson@apple.com>
3208
3209         Log media time range as JSON
3210         https://bugs.webkit.org/show_bug.cgi?id=185321
3211         <rdar://problem/39986746>
3212
3213         Reviewed by Youenn Fablet.
3214
3215         No new tests, tested manually.
3216
3217         * html/HTMLMediaElement.cpp:
3218         (WebCore::HTMLMediaElement::addPlayedRange): Log as time range.
3219         (WebCore::HTMLMediaElement::visibilityStateChanged): Cleanup.
3220
3221         * platform/graphics/MediaPlayer.h:
3222         (WTF::LogArgument<MediaTime>::toString):
3223         (WTF::LogArgument<MediaTimeRange>::toString):
3224
3225         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
3226         (WebCore::InbandTextTrackPrivateAVF::processAttributedStrings): Log error as time range.
3227
3228 2018-05-04  Zalan Bujtas  <zalan@apple.com>
3229
3230         Use the containing block to compute the pagination gap when the container is inline.
3231         https://bugs.webkit.org/show_bug.cgi?id=184724
3232         <rdar://problem/39521800>
3233
3234         Reviewed by Simon Fraser.
3235
3236         Test: fast/overflow/page-overflow-with-inline-body-crash.html
3237
3238         * page/FrameView.cpp:
3239         (WebCore::FrameView::applyPaginationToViewport):
3240
3241 2018-05-04  Tim Horton  <timothy_horton@apple.com>
3242
3243         Don't use GSFont* in minimal simulator mode
3244         https://bugs.webkit.org/show_bug.cgi?id=185320
3245         <rdar://problem/39734478>
3246
3247         Reviewed by Beth Dakin.
3248
3249         * page/cocoa/MemoryReleaseCocoa.mm:
3250         (WebCore::platformReleaseMemory):
3251
3252 2018-05-04  Chris Dumez  <cdumez@apple.com>
3253
3254         Unreviewed, rolling out r231331.
3255
3256         Caused a few tests to assert
3257
3258         Reverted changeset:
3259
3260         "Stop using an iframe's id as fallback if its name attribute
3261         is not set"
3262         https://bugs.webkit.org/show_bug.cgi?id=11388
3263         https://trac.webkit.org/changeset/231331
3264
3265 2018-05-04  Youenn Fablet  <youenn@apple.com>
3266
3267         Use more references in updateTracksOfType
3268         https://bugs.webkit.org/show_bug.cgi?id=185305
3269
3270         Reviewed by Eric Carlson.
3271
3272         No change of behavior.
3273
3274         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
3275         (WebCore::updateTracksOfType):
3276         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks):
3277
3278 2018-05-04  Myles C. Maxfield  <mmaxfield@apple.com>
3279
3280         Text shaping in the simple path is flipped in the y direction
3281         https://bugs.webkit.org/show_bug.cgi?id=185062
3282         <rdar://problem/39778678>
3283
3284         Reviewed by Simon Fraser.
3285
3286         Shaping in our simple codepath occurs in an "increasing-y-goes-up" coordinate system, but our painting
3287         code uses an "increasing-y-goes-down" coordinate system. We weren't fixing up the coordinate systems
3288         because we never noticed. This is because the simple codepath is only designed for kerning and ligatures,
3289         neither of which move glyphs vertically in the common case.
3290
3291         Test: fast/text/vertical-displacement-simple-codepath.html
3292
3293         * platform/graphics/Font.cpp:
3294         (WebCore::Font::applyTransforms const):
3295         * platform/graphics/WidthIterator.cpp:
3296         (WebCore::WidthIterator::applyFontTransforms):
3297
3298 2018-05-04  Chris Nardi  <cnardi@chromium.org>
3299
3300         Serialize all URLs with double-quotes per CSSOM spec
3301         https://bugs.webkit.org/show_bug.cgi?id=184935
3302
3303         Reviewed by Antti Koivisto.
3304
3305         According to https://drafts.csswg.org/cssom/#serialize-a-url, all URLs should be serialized as strings,
3306         which means they should have double quotes around the text of the URL. Update our implementation to match
3307         this (and Firefox/Chrome). Also remove isCSSTokenizerURL() as this method is no longer needed.
3308
3309         Tests: Many LayoutTests updated to use double quotes.
3310
3311         * css/CSSMarkup.cpp:
3312         (WebCore::serializeString): Remove FIXME as this was already fixed in a previous patch.
3313         (WebCore::serializeURL): Remove FIXME and update implementation.
3314
3315 2018-05-04  Youenn Fablet  <youenn@apple.com>
3316
3317         LayoutTests/fast/mediastream/change-tracks-media-stream-being-played.html is crashing after r231304
3318         https://bugs.webkit.org/show_bug.cgi?id=185303
3319
3320         Reviewed by Eric Carlson.
3321
3322         We need to stop observing the audio track like we do for video track once we are no longer interested in it.
3323         Covered by test no longer crashing.
3324
3325         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
3326         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks):
3327
3328 2018-05-04  Zalan Bujtas  <zalan@apple.com>
3329
3330         [LFC] Set the invalidation root as the result of style change.
3331         https://bugs.webkit.org/show_bug.cgi?id=185301
3332
3333         Reviewed by Antti Koivisto.
3334
3335         Compute/propagate the update type on the ancestor chain and return the invalidation root
3336         so that LayoutContext could use it as the entry point for the next layout frame.
3337
3338         * layout/LayoutContext.cpp:
3339         (WebCore::Layout::LayoutContext::updateLayout):
3340         (WebCore::Layout::LayoutContext::styleChanged):
3341         * layout/LayoutContext.h: order is not important.
3342         * layout/blockformatting/BlockInvalidation.cpp:
3343         (WebCore::Layout::invalidationStopsAtFormattingContextBoundary):
3344         (WebCore::Layout::computeUpdateType):
3345         (WebCore::Layout::computeUpdateTypeForAncestor):
3346         (WebCore::Layout::BlockInvalidation::invalidate):
3347         * layout/blockformatting/BlockInvalidation.h:
3348         * layout/inlineformatting/InlineInvalidation.cpp:
3349         (WebCore::Layout::InlineInvalidation::invalidate):
3350         * layout/inlineformatting/InlineInvalidation.h:
3351
3352 2018-05-04  Youenn Fablet  <youenn@apple.com>
3353
3354         PeerConnection should have its connectionState closed even if doing gathering
3355         https://bugs.webkit.org/show_bug.cgi?id=185267
3356
3357         Reviewed by Darin Adler.
3358
3359         Test: webrtc/addICECandidate-closed.html
3360
3361         In case m_iceConnectionState is closed, m_connectionState should also be set to closed
3362         and RTCPeerConnection should be closed so as to reject any other call.
3363
3364         * Modules/mediastream/RTCPeerConnection.cpp:
3365         (WebCore::RTCPeerConnection::close):
3366         (WebCore::RTCPeerConnection::updateConnectionState):
3367
3368 2018-05-04  Yacine Bandou  <yacine.bandou_ext@softathome.com>
3369
3370         [MSE][GStreamer] Delete properly the stream from the WebKitMediaSource
3371         https://bugs.webkit.org/show_bug.cgi?id=185242
3372
3373         Reviewed by Xabier Rodriguez-Calvar.
3374
3375         When the sourceBuffer is removed from mediasource, the appropriate stream is not
3376         properly deleted from WebKitMediaSource, because the appsrc and parser elements
3377         of the stream are not removed from the WebKitMediaSource bin.
3378
3379         This patch avoids the regression of r231089, see https://bugs.webkit.org/show_bug.cgi?id=185071
3380
3381         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
3382         (webKitMediaSrcFreeStream):
3383
3384 2018-05-04  Carlos Garcia Campos  <cgarcia@igalia.com>
3385
3386         [GTK] Epiphany (GNOME Web) says "Error downloading: Service Unavailable." when trying to download an image from discogs.com
3387         https://bugs.webkit.org/show_bug.cgi?id=174730
3388
3389         Reviewed by Michael Catanzaro.
3390
3391         Export ResourceRequestBase::hasHTTPHeaderField().
3392
3393         * platform/network/ResourceRequestBase.h:
3394
3395 2018-05-03  Yusuke Suzuki  <utatane.tea@gmail.com>
3396
3397         Use subprocess.call instead of os.system to handle path with spaces
3398         https://bugs.webkit.org/show_bug.cgi?id=185291
3399
3400         Reviewed by Darin Adler.
3401
3402         If gperf path includes spaces, these python scripts fail to execute gperf.
3403         We use subprocess module instead of os.system to invoke gperf.
3404
3405         * css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
3406         * css/makeSelectorPseudoElementsMap.py:
3407         * platform/network/create-http-header-name-table:
3408
3409 2018-05-03  Yusuke Suzuki  <utatane.tea@gmail.com>
3410
3411         Unreviewed, attempt to fix WinCairo build failure
3412         https://bugs.webkit.org/show_bug.cgi?id=185218
3413
3414         * platform/text/win/LocaleWin.cpp:
3415         (WebCore::LocaleWin::getLocaleInfoString):
3416
3417 2018-05-03  Filip Pizlo  <fpizlo@apple.com>
3418
3419         Strings should not be allocated in a gigacage
3420         https://bugs.webkit.org/show_bug.cgi?id=185218
3421
3422         Reviewed by Saam Barati.
3423
3424         No new tests because no new behavior.
3425
3426         * Modules/indexeddb/server/IDBSerialization.cpp:
3427         (WebCore::decodeKey):
3428         * bindings/js/SerializedScriptValue.cpp:
3429         (WebCore::CloneDeserializer::readString):
3430         * html/canvas/CanvasRenderingContext2D.cpp:
3431         (WebCore::normalizeSpaces):
3432         * html/parser/HTMLTreeBuilder.cpp:
3433         (WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::takeRemainingWhitespace):
3434         * platform/URLParser.cpp:
3435         (WebCore::percentEncodeByte):
3436         (WebCore::serializeURLEncodedForm):
3437         (WebCore::URLParser::serialize):
3438         * platform/URLParser.h:
3439         * platform/graphics/FourCC.cpp:
3440         (WebCore::FourCC::toString const):
3441         * platform/graphics/ca/GraphicsLayerCA.cpp:
3442         (WebCore::GraphicsLayerCA::ReplicaState::cloneID const):
3443         * platform/text/LocaleICU.cpp:
3444         (WebCore::LocaleICU::decimalSymbol):
3445         (WebCore::LocaleICU::decimalTextAttribute):
3446         (WebCore::getDateFormatPattern):
3447         (WebCore::LocaleICU::createLabelVector):
3448         (WebCore::getFormatForSkeleton):
3449         * platform/win/FileSystemWin.cpp:
3450         (WebCore::FileSystem::getFinalPathName):
3451         (WebCore::FileSystem::pathByAppendingComponent):
3452         (WebCore::FileSystem::storageDirectory):
3453
3454 2018-05-02  Brent Fulgham  <bfulgham@apple.com>
3455
3456         Widgets should hold a WeakPtr to their parents
3457         https://bugs.webkit.org/show_bug.cgi?id=185239
3458         <rdar://problem/39741250>
3459
3460         Reviewed by Zalan Bujtas.
3461
3462         * platform/ScrollView.h:
3463         (WebCore::ScrollView::weakPtrFactory): Added.
3464         * platform/Widget.cpp:
3465         (WebCore::Widget::init): Don't perform an unnecessary assignment.
3466         (WebCore::Widget::setParent): Grab a WeakPtr to the parent ScrollView.
3467         * platform/Widget.h:
3468         (WebCore::Widget::parent const): Change type to a WeakPtr.
3469
3470 2018-05-03  Yusuke Suzuki  <utatane.tea@gmail.com>
3471
3472         Use pointer instead of std::optional<T&>
3473         https://bugs.webkit.org/show_bug.cgi?id=185186
3474
3475         Reviewed by Alex Christensen.
3476
3477         std::optional<T&> is not accepted in C++17 spec.
3478         In this patch, we replace it with T*, which is well-aligned to
3479         WebKit's convention.
3480
3481         * Modules/mediastream/RTCPeerConnection.cpp:
3482         (WebCore::iceServersFromConfiguration):
3483         (WebCore::RTCPeerConnection::initializeConfiguration):
3484         (WebCore::RTCPeerConnection::setConfiguration):
3485         * css/parser/CSSParser.cpp:
3486         (WebCore::CSSParser::parseSystemColor):
3487         * css/parser/CSSParser.h:
3488         * dom/DatasetDOMStringMap.cpp:
3489         (WebCore::DatasetDOMStringMap::item const):
3490         (WebCore::DatasetDOMStringMap::namedItem const):
3491         (WebCore:: const): Deleted.
3492         * dom/DatasetDOMStringMap.h:
3493         * dom/Element.cpp:
3494         (WebCore::Element::insertAdjacentHTML):
3495         * dom/Element.h:
3496         * html/canvas/CanvasStyle.cpp:
3497         (WebCore::parseColor):
3498         * inspector/DOMEditor.cpp:
3499         * platform/network/curl/CurlFormDataStream.cpp:
3500         (WebCore::CurlFormDataStream::getPostData):
3501         (): Deleted.
3502         * platform/network/curl/CurlFormDataStream.h:
3503         * platform/network/curl/CurlRequest.cpp:
3504         (WebCore::CurlRequest::setupPOST):
3505         * testing/MockCDMFactory.cpp:
3506         (WebCore::MockCDMFactory::keysForSessionWithID const):
3507         (WebCore::MockCDMInstance::updateLicense):
3508         (WebCore:: const): Deleted.
3509         * testing/MockCDMFactory.h:
3510
3511 2018-05-03  Chris Dumez  <cdumez@apple.com>
3512
3513         Stop using an iframe's id as fallback if its name attribute is not set
3514         https://bugs.webkit.org/show_bug.cgi?id=11388
3515
3516         Reviewed by Geoff Garen.
3517
3518         WebKit had logic to use an iframe's id as fallback name when its name
3519         content attribute is not set. This behavior was not standard and did not
3520         match other browsers:
3521         - https://html.spec.whatwg.org/#attr-iframe-name
3522
3523         Gecko / Trident never behaved this way. Blink was aligned with us until
3524         they started to match the specification in:
3525         - https://bugs.chromium.org/p/chromium/issues/detail?id=347169
3526
3527         This WebKit quirk was causing some Web-compatibility issues because it
3528         would affect the behavior of Window's name property getter when trying
3529         to look up an iframe by id. Because of Window's named property getter
3530         behavior [1], we would return the frame's contentWindow instead of the
3531         iframe element itself.
3532
3533         [1] https://html.spec.whatwg.org/multipage/window-object.html#named-access-on-the-window-object
3534
3535         Test: fast/dom/Window/named-getter-frame-id.html
3536
3537         * html/HTMLFrameElementBase.cpp:
3538         (WebCore::HTMLFrameElementBase::openURL):
3539         (WebCore::HTMLFrameElementBase::parseAttribute):
3540         (WebCore::HTMLFrameElementBase::didFinishInsertingNode):
3541         * html/HTMLFrameElementBase.h:
3542
3543 2018-05-03  Eric Carlson  <eric.carlson@apple.com>
3544
3545         [iOS] Internal text and audio tracks not in fullscreen menu
3546         https://bugs.webkit.org/show_bug.cgi?id=185268
3547         <rdar://problem/38673440>
3548
3549         Reviewed by Jer Noble.
3550
3551         * platform/cocoa/PlaybackSessionModelMediaElement.mm:
3552         (WebCore::PlaybackSessionModelMediaElement::setMediaElement): 'addtrack' and 'removetrack'
3553         events are fired at the track lists, not the media element.
3554
3555 2018-05-03  Ryosuke Niwa  <rniwa@webkit.org>
3556
3557         Using image map inside a shadow tree results hits a release assert in DocumentOrderedMap::add
3558         https://bugs.webkit.org/show_bug.cgi?id=185238
3559
3560         Reviewed by Antti Koivisto.
3561
3562         The bug was caused by DocumentOrderedMap for the image elements with usemap being stored in Document
3563         even if those image elements were in a shadow tree. Fixed the bug by moving the map to TreeScope.
3564
3565         Test: fast/images/imagemap-in-nested-shadow-tree.html
3566               fast/images/imagemap-in-shadow-tree.html
3567
3568         * dom/Document.cpp:
3569         (WebCore::Document::addImageElementByUsemap): Moved to TreeScope.
3570         (WebCore::Document::removeImageElementByUsemap): Ditto.
3571         (WebCore::Document::imageElementByUsemap const): Ditto.
3572         * dom/Document.h:
3573         * dom/TreeScope.cpp:
3574         (WebCore::TreeScope::destroyTreeScopeData): Clear m_imagesByUsemap as well as m_elementsByName.
3575         (WebCore::TreeScope::getImageMap const): Removed the code to parse usemap. RenderImage::imageMap()
3576         which used to call this function with the raw value of the usemap content attribute now calls it
3577         via HTMLImageElement::associatedMapElement(), which uses the parsed usemap.
3578         (WebCore::TreeScope::addImageElementByUsemap): Moved from Document.
3579         (WebCore::TreeScope::removeImageElementByUsemap): Ditto.
3580         (WebCore::TreeScope::imageElementByUsemap const): Ditto.
3581         * dom/TreeScope.h:
3582         * html/HTMLImageElement.cpp:
3583         (WebCore::HTMLImageElement::parseAttribute):
3584         (WebCore::HTMLImageElement::insertedIntoAncestor): This image element can be associated with a map element
3585         if it's connected to a document.
3586         (WebCore::HTMLImageElement::removedFromAncestor):
3587         (WebCore::HTMLImageElement::associatedMapElement const):
3588         * html/HTMLImageElement.h:
3589         * html/HTMLMapElement.cpp:
3590         (WebCore::HTMLMapElement::imageElement):
3591         * rendering/RenderImage.cpp:
3592         (WebCore::RenderImage::imageMap const):
3593
3594 2018-05-03  Justin Fan  <justin_fan@apple.com>
3595
3596         [WebGL] Add runtime flag for enabling ASTC support in WebGL
3597         https://bugs.webkit.org/show_bug.cgi?id=184840
3598
3599         Reviewed by Myles C. Maxfield.
3600
3601         Added runtime flag for ASTC support in WebGL, to turn on/off when extension is implemented.
3602
3603         * page/RuntimeEnabledFeatures.h:
3604         (WebCore::RuntimeEnabledFeatures::setWebGLCompressedTextureASTCSupportEnabled):
3605         (WebCore::RuntimeEnabledFeatures::webGLCompressedTextureASTCSupportEnabled const):
3606
3607 2018-05-03  Chris Nardi  <cnardi@chromium.org>
3608
3609         Remove [NoInterfaceObject] from DOMRectList
3610         https://bugs.webkit.org/show_bug.cgi?id=185255
3611
3612         Reviewed by Chris Dumez.
3613
3614         In https://github.com/w3c/fxtf-drafts/issues/233, [NoInterfaceObject] was removed
3615         from DOMRectList. Remove it from our implementation to match the spec, as well as
3616         Chrome and Firefox.
3617
3618         Updated web platform tests IDL test for the Geometry spec.
3619
3620         * dom/DOMRectList.idl:
3621
3622 2018-05-03  Chris Dumez  <cdumez@apple.com>
3623
3624         REGRESSION(iOS 11.3): Crashes in TimerBase::~TimerBase() in Tencent x5gamehelper
3625         https://bugs.webkit.org/show_bug.cgi?id=185073
3626         <rdar://problem/39821223>
3627
3628         Reviewed by Alexey Proskuryakov.
3629
3630         The following changes were made:
3631         - Make sure SocketStream callbacks are always scheduled on the right runloop:
3632           WebThreadRunLoop() on WebKitLegacy iOS, loaderRunLoop() on Windows and
3633           main runloop otherwise.
3634         - When the SocketStream callbacks are called, unconditionally call callOnMainThreadAndWait()
3635           before calling methods on the SocketStream client. Previously, this code path
3636           was specific to Windows but there is no reason to have platform-specific code here.
3637           callOnMainThreadAndWait() calls the function right away if we're already on the main
3638           thread, which will be the case on other platform than Windows.
3639
3640         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
3641         (WebCore::callbacksRunLoop):
3642         (WebCore::callbacksRunLoopMode):
3643         (WebCore::SocketStreamHandleImpl::scheduleStreams):
3644         (WebCore::SocketStreamHandleImpl::pacExecutionCallback):
3645         (WebCore::SocketStreamHandleImpl::executePACFileURL):
3646         (WebCore::SocketStreamHandleImpl::removePACRunLoopSource):
3647         (WebCore::SocketStreamHandleImpl::readStreamCallback):
3648         (WebCore::SocketStreamHandleImpl::writeStreamCallback):
3649         (WebCore::SocketStreamHandleImpl::platformClose):
3650
3651 2018-05-03  Zalan Bujtas  <zalan@apple.com>
3652
3653         [LFC] Enable multiple layout roots for incremental layout.
3654         https://bugs.webkit.org/show_bug.cgi?id=185185
3655
3656         Reviewed by Antti Koivisto.
3657
3658         With certain type of style changes, we can stop the box invalidation at the formatting context boundary.
3659         When multiple boxes need updating in different formatting contexts, instead of marking the parent containing block chain all
3660         the way up to a common ancestor, we could just work with a list of layout entry points per layout frame.
3661
3662         * layout/FormattingState.h:
3663         * layout/LayoutContext.cpp:
3664         (WebCore::Layout::LayoutContext::updateLayout):
3665         (WebCore::Layout::LayoutContext::addLayoutEntryPoint):
3666         * layout/LayoutContext.h:
3667
3668 2018-05-03  Zalan Bujtas  <zalan@apple.com>
3669
3670         [LFC] Box invalidation logic should go to dedicated classes.
3671         https://bugs.webkit.org/show_bug.cgi?id=185249
3672
3673         Reviewed by Antti Koivisto.
3674
3675         Each formatting context can initiate a different type of invalidation when
3676         style attribute changes in a box.
3677
3678         * Sources.txt:
3679         * WebCore.xcodeproj/project.pbxproj:
3680         * layout/FormattingState.cpp:
3681         (WebCore::Layout::FormattingState::FormattingState):
3682         * layout/FormattingState.h:
3683         (WebCore::Layout::FormattingState::isBlockFormattingState const):
3684         (WebCore::Layout::FormattingState::isInlineFormattingState const):
3685         * layout/LayoutContext.cpp:
3686         (WebCore::Layout::LayoutContext::styleChanged):
3687         (WebCore::Layout::LayoutContext::markNeedsUpdate):
3688         * layout/LayoutContext.h:
3689         * layout/blockformatting/BlockFormattingState.cpp:
3690         (WebCore::Layout::BlockFormattingState::BlockFormattingState):
3691         * layout/blockformatting/BlockFormattingState.h:
3692         * layout/blockformatting/BlockInvalidation.cpp: Copied from Source/WebCore/layout/blockformatting/BlockFormattingState.cpp.
3693         (WebCore::Layout::BlockInvalidation::invalidate):
3694         * layout/blockformatting/BlockInvalidation.h: Copied from Source/WebCore/layout/inlineformatting/InlineFormattingState.h.
3695         * layout/inlineformatting/InlineFormattingState.cpp:
3696         (WebCore::Layout::InlineFormattingState::InlineFormattingState):
3697         * layout/inlineformatting/InlineFormattingState.h:
3698         * layout/inlineformatting/InlineInvalidation.cpp: Copied from Source/WebCore/layout/inlineformatting/InlineFormattingState.cpp.
3699         (WebCore::Layout::InlineInvalidation::invalidate):
3700         * layout/inlineformatting/InlineInvalidation.h: Copied from Source/WebCore/layout/blockformatting/BlockFormattingState.h.
3701
3702 2018-05-03  Michael Catanzaro  <mcatanzaro@igalia.com>
3703
3704         WebKit should send fake macOS user agent to docs.google.com
3705         https://bugs.webkit.org/show_bug.cgi?id=185165
3706
3707         Reviewed by Carlos Garcia Campos.
3708
3709         * platform/UserAgentQuirks.cpp:
3710         (WebCore::urlRequiresMacintoshPlatform):
3711         (WebCore::urlRequiresLinuxDesktopPlatform):
3712
3713 2018-05-03  Commit Queue  <commit-queue@webkit.org>
3714
3715         Unreviewed, rolling out r231223 and r231288.
3716         https://bugs.webkit.org/show_bug.cgi?id=185256
3717
3718         The change in r231223 breaks internal builds, and r231288 is a
3719         dependent change. (Requested by ryanhaddad on #webkit).
3720
3721         Reverted changesets:
3722
3723         "Use default std::optional if it is provided"
3724         https://bugs.webkit.org/show_bug.cgi?id=185159
3725         https://trac.webkit.org/changeset/231223
3726
3727         "Use pointer instead of
3728         std::optional<std::reference_wrapper<>>"
3729         https://bugs.webkit.org/show_bug.cgi?id=185186
3730         https://trac.webkit.org/changeset/231288
3731
3732 2018-05-03  Ryan Haddad  <ryanhaddad@apple.com>
3733
3734         Unreviewed, rolling out r231253.
3735
3736         The API test added with this change is crashing on the bots.
3737
3738         Reverted changeset:
3739
3740         "Web Inspector: opt out of process swap on navigation if a Web
3741         Inspector frontend is connected"
3742         https://bugs.webkit.org/show_bug.cgi?id=184861
3743         https://trac.webkit.org/changeset/231253
3744
3745 2018-05-03  Youenn Fablet  <youenn@apple.com>
3746
3747         A MediaStream being played should allow removing some of its tracks
3748         https://bugs.webkit.org/show_bug.cgi?id=185233
3749
3750         Reviewed by Eric Carlson.
3751
3752         Update the tracks out of the for loop.
3753         Test: fast/mediastream/change-tracks-media-stream-being-played.html
3754
3755         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
3756         (WebCore::updateTracksOfType):
3757
3758 2018-05-03  Miguel Gomez  <magomez@igalia.com>
3759
3760         WebCore::TextureMapperLayer object used after freed
3761         https://bugs.webkit.org/show_bug.cgi?id=184729
3762
3763         Reviewed by Michael Catanzaro.
3764
3765         Replace the raw pointers with WeakPtr for effectTarget, maskLayer and replicaLayer
3766         inside TextureMapperLayer.
3767
3768         * platform/graphics/texmap/TextureMapperLayer.cpp:
3769         (WebCore::TextureMapperLayer::~TextureMapperLayer):
3770         (WebCore::TextureMapperLayer::setMaskLayer):
3771         (WebCore::TextureMapperLayer::setReplicaLayer):
3772         * platform/graphics/texmap/TextureMapperLayer.h:
3773
3774 2018-05-03  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3775
3776         [Curl] Add OpenSSL/LibreSSL multi-threading support
3777         https://bugs.webkit.org/show_bug.cgi?id=185138
3778
3779         The older OpenSSL manual says the locking_function and threadid_function should
3780         be set when use it in multi-threading environment. This applies to LibreSSL also.
3781         https://www.openssl.org/docs/man1.0.2/crypto/threads.html
3782
3783         For unix and other similar os, the default threadId_function implementation is
3784         good enough. We'll set custom callback only for Windows OS.
3785
3786         Note it's not required for OpenSSL 1.1.0 and after.
3787         https://www.openssl.org/blog/blog/2017/02/21/threads/
3788
3789         Reviewed by Per Arne Vollan.
3790
3791         * platform/network/curl/CurlSSLHandle.cpp:
3792         (WebCore::CurlSSLHandle::CurlSSLHandle):
3793         (WebCore::CurlSSLHandle::ThreadSupport::ThreadSupport):
3794         (WebCore::CurlSSLHandle::ThreadSupport::lockingCallback):
3795         (WebCore::CurlSSLHandle::ThreadSupport::threadIdCallback):
3796         * platform/network/curl/CurlSSLHandle.h:
3797         (WebCore::CurlSSLHandle::ThreadSupport::setup):
3798         (WebCore::CurlSSLHandle::ThreadSupport::singleton):
3799         (WebCore::CurlSSLHandle::ThreadSupport::lock):
3800         (WebCore::CurlSSLHandle::ThreadSupport::unlock):
3801
3802 2018-05-02  Ryosuke Niwa  <rniwa@webkit.org>
3803
3804         Remove superfluous check for a null attribute value check in Element::removeAttributeInternal
3805         https://bugs.webkit.org/show_bug.cgi?id=185227
3806
3807         Reviewed by Chris Dumez.
3808
3809         Removed the check. The attribute value string can never be null.
3810
3811         * dom/Element.cpp:
3812         (WebCore::Element::removeAttributeInternal):
3813
3814 2018-05-02  Zalan Bujtas  <zalan@apple.com>
3815
3816         [LFC] Implement LayoutContext::createDisplayBox
3817         https://bugs.webkit.org/show_bug.cgi?id=185158
3818
3819         Reviewed by Antti Koivisto.
3820
3821         Now compute*() functions take both the const layout and the corresponding non-const display boxes.
3822         Display boxes are owned by the LayoutContext and they don't form a tree structure (only implicitly through the layout tree).
3823         (This might need to change in the future if we decide to arrange them in some sort of painting order)
3824
3825         * layout/FloatingContext.cpp:
3826         (WebCore::Layout::FloatingContext::computePosition):
3827         * layout/FloatingContext.h:
3828         * layout/FormattingContext.cpp:
3829         (WebCore::Layout::FormattingContext::computeStaticPosition const):
3830         (WebCore::Layout::FormattingContext::computeInFlowPositionedPosition const):
3831         (WebCore::Layout::FormattingContext::computeOutOfFlowPosition const):
3832         (WebCore::Layout::FormattingContext::computeWidth const):
3833         (WebCore::Layout::FormattingContext::computeHeight const):
3834         (WebCore::Layout::FormattingContext::computeOutOfFlowWidth const):
3835         (WebCore::Layout::FormattingContext::computeFloatingWidth const):
3836         (WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
3837         (WebCore::Layout::FormattingContext::computeFloatingHeight const):
3838         * layout/FormattingContext.h:
3839         * layout/LayoutContext.cpp:
3840         (WebCore::Layout::LayoutContext::createDisplayBox):
3841         * layout/LayoutContext.h:
3842         (WebCore::Layout::LayoutContext::displayBoxForLayoutBox const):
3843         * layout/blockformatting/BlockFormattingContext.cpp:
3844         (WebCore::Layout::BlockFormattingContext::layout const):
3845         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
3846         (WebCore::Layout::BlockFormattingContext::computeInFlowWidth const):
3847         (WebCore::Layout::BlockFormattingContext::computeInFlowHeight const):
3848         * layout/blockformatting/BlockFormattingContext.h:
3849         * layout/displaytree/DisplayBox.h:
3850         (WebCore::Display::Box::parent const): Deleted.
3851         (WebCore::Display::Box::nextSibling const): Deleted.
3852         (WebCore::Display::Box::previousSibling const): Deleted.
3853         (WebCore::Display::Box::firstChild const): Deleted.
3854         (WebCore::Display::Box::lastChild const): Deleted.
3855         (WebCore::Display::Box::setParent): Deleted.
3856         (WebCore::Display::Box::setNextSibling): Deleted.
3857         (WebCore::Display::Box::setPreviousSibling): Deleted.
3858         (WebCore::Display::Box::setFirstChild): Deleted.
3859         (WebCore::Display::Box::setLastChild): Deleted.
3860         (): Deleted.
3861         * layout/inlineformatting/InlineFormattingContext.cpp:
3862         (WebCore::Layout::InlineFormattingContext::computeInFlowWidth const):
3863         (WebCore::Layout::InlineFormattingContext::computeInFlowHeight const):
3864         * layout/inlineformatting/InlineFormattingContext.h:
3865
3866 2018-05-02  Said Abou-Hallawa  <sabouhallawa@apple.com>
3867
3868         Hiding then showing an <object> of type image makes the underlaying image disappear
3869         https://bugs.webkit.org/show_bug.cgi?id=185216
3870         <rdar://problem/39055630>
3871
3872         Reviewed by Youenn Fablet.
3873
3874         Ensure the HTMLPlugInImageElement updates the RenderImageResource of its
3875         RenderImage with the CachedImage of its ImageLoader when the RenderImage
3876         is recreated.
3877
3878         Test: fast/images/object-image-hide-show.html
3879
3880         * html/HTMLPlugInImageElement.cpp:
3881         (WebCore::HTMLPlugInImageElement::didAttachRenderers):
3882         This is very similar to what we do in HTMLImageElement::didAttachRenderers().
3883
3884
3885 2018-05-02  Brent Fulgham  <bfulgham@apple.com>
3886
3887         Use RetainPtr for form input type
3888         https://bugs.webkit.org/show_bug.cgi?id=185210
3889         <rdar://problem/39734040>
3890
3891         Reviewed by Ryosuke Niwa.
3892
3893         Refactor our HTMLInputElement class to store its InputType member as a RefPtr.
3894
3895         Test: fast/forms/access-key-mutation-2.html.
3896
3897         * html/HTMLInputElement.cpp:
3898         (WebCore::HTMLInputElement::HTMLInputElement):
3899         (WebCore::HTMLInputElement::didAddUserAgentShadowRoot):
3900         (WebCore::HTMLInputElement::accessKeyAction):
3901         (WebCore::HTMLInputElement::parseAttribute):
3902         (WebCore::HTMLInputElement::appendFormData):
3903         * html/HTMLInputElement.h:
3904         * html/InputType.cpp:
3905         (WebCore::createInputType):
3906         (WebCore::InputType::create):
3907         (WebCore::InputType::createText):
3908         * html/InputType.h:
3909
3910 2018-05-01  Yusuke Suzuki  <utatane.tea@gmail.com>
3911
3912         Use pointer instead of std::optional<std::reference_wrapper<>>
3913         https://bugs.webkit.org/show_bug.cgi?id=185186
3914
3915         Reviewed by Alex Christensen.
3916
3917         std::optional<T&> is not accepted in C++17 spec. So we replaced it
3918         with std::optional<std::reference_wrapper<T>>.
3919
3920         In this patch, we replace it with T*, which is well-aligned to
3921         WebKit's convention.
3922
3923         * Modules/mediastream/RTCPeerConnection.cpp:
3924         (WebCore::iceServersFromConfiguration):
3925         (WebCore::RTCPeerConnection::initializeConfiguration):
3926         (WebCore::RTCPeerConnection::setConfiguration):
3927         * css/parser/CSSParser.cpp:
3928         (WebCore::CSSParser::parseSystemColor):
3929         * css/parser/CSSParser.h:
3930         * dom/DatasetDOMStringMap.cpp:
3931         (WebCore::DatasetDOMStringMap::item const):
3932         (WebCore::DatasetDOMStringMap::namedItem const):
3933         * dom/DatasetDOMStringMap.h:
3934         * dom/Element.cpp:
3935         (WebCore::Element::insertAdjacentHTML):
3936         * dom/Element.h:
3937         * html/canvas/CanvasStyle.cpp:
3938         (WebCore::parseColor):
3939         * inspector/DOMEditor.cpp:
3940         * platform/network/curl/CurlFormDataStream.cpp:
3941         (WebCore::CurlFormDataStream::getPostData):
3942         * platform/network/curl/CurlFormDataStream.h:
3943         * platform/network/curl/CurlRequest.cpp:
3944         (WebCore::CurlRequest::setupPOST):
3945         * testing/MockCDMFactory.cpp:
3946         (WebCore::MockCDMFactory::keysForSessionWithID const):
3947         (WebCore::MockCDMInstance::updateLicense):
3948         * testing/MockCDMFactory.h:
3949
3950 2018-05-02  Keith Rollin  <krollin@apple.com>
3951
3952         Add facility for tracking times and results of page and resource loading
3953         https://bugs.webkit.org/show_bug.cgi?id=184838
3954         <rdar://problem/36548974>
3955
3956         Reviewed by Brent Fulgham.
3957
3958         Update FrameProgressTracker to send the necessary page load start/stop
3959         signals so that we can track the entire page load at a network level.
3960         Add an empty override of the pure virtual
3961         LoaderStrategy::pageLoadCompleted method.
3962
3963         No new tests. There is no testable effect from these changes. On
3964         Cocoa, measurable changes take place in another (non-WebKit) process.
3965         On non-Cocoa systems, this facility is currently disabled.
3966
3967         * loader/FrameLoader.cpp:
3968         (WebCore::FrameLoader::FrameProgressTracker::progressCompleted):
3969         * loader/LoaderStrategy.h:
3970
3971 2018-05-02  Aditya Keerthi  <akeerthi@apple.com>
3972
3973         Can't copy and paste URLs that have no title into Mail (macOS)
3974         https://bugs.webkit.org/show_bug.cgi?id=185205
3975         <rdar://problem/36352406>
3976
3977         Reviewed by Tim Horton.
3978
3979         The pasteboardURL generated has an empty title for URLs without titles. Currently, the pasteboardURL.title is being saved to the pasteboard.
3980
3981         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.
3982
3983         Augmented WebKitLegacy.ContextMenuCanCopyURL test
3984
3985         * platform/mac/PasteboardMac.mm:
3986         (WebCore::writeURLForTypes):
3987
3988 2018-05-01  Ryosuke Niwa  <rniwa@webkit.org>
3989
3990         REGRESSION(r225868): Release assert when removing an SVGUseElement from Document::m_svgUseElements
3991         https://bugs.webkit.org/show_bug.cgi?id=182188
3992         <rdar://problem/36689240>
3993
3994         Reviewed by Antti Koivisto.