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