Parse font-display
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-08-14  Myles C. Maxfield  <mmaxfield@apple.com>
2
3         Parse font-display
4         https://bugs.webkit.org/show_bug.cgi?id=175382
5
6         Reviewed by Simon Fraser.
7
8         The syntax is very simple: font-display: auto | block | swap | fallback | optional.
9         So, parsing support is quite straightfoward.
10
11         Test: fast/text/font-display/parse.html
12
13         * css/CSSComputedStyleDeclaration.cpp:
14         (WebCore::ComputedStyleExtractor::propertyValue):
15         * css/CSSFontFace.cpp:
16         (WebCore::CSSFontFace::setLoadingBehavior):
17         * css/CSSFontFace.h:
18         * css/CSSFontSelector.cpp:
19         (WebCore::CSSFontSelector::addFontFaceRule):
20         * css/CSSPrimitiveValueMappings.h:
21         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
22         (WebCore::CSSPrimitiveValue::operator FontLoadingBehavior const):
23         * css/CSSProperties.json:
24         * css/CSSProperty.cpp:
25         (WebCore::CSSProperty::isDescriptorOnly):
26         * css/CSSValueKeywords.in:
27         * css/parser/CSSPropertyParser.cpp:
28         (WebCore::consumeFontFaceFontDisplay):
29         (WebCore::CSSPropertyParser::parseFontFaceDescriptor):
30         * rendering/style/RenderStyleConstants.h:
31
32 2017-08-14  Jer Noble  <jer.noble@apple.com>
33
34         Obj-C exception crash in AVStreamSession when using EME in Private Browsing mode
35         https://bugs.webkit.org/show_bug.cgi?id=175547
36
37         Reviewed by Eric Carlson.
38
39         When the storagePath() is empty, do not use those AVStreamSession APIs which require a valid file path to stored
40         proof-of-key-release data.
41
42         Drive-by fix: return emptyString() from HTMLMediaElement::mediaPlayerMediaKeysStorageDirectory() when in Private
43         Browsing mode, to match the behavior of WebKitMediaKeySession.
44
45         * html/HTMLMediaElement.cpp:
46         (WebCore::HTMLMediaElement::mediaPlayerMediaKeysStorageDirectory const):
47         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
48         (WebCore::CDMSessionAVStreamSession::releaseKeys):
49         (WebCore::CDMSessionAVStreamSession::update):
50         (WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage):
51
52 2017-08-14  Andy Estes  <aestes@apple.com>
53
54         REGRESSION (r220456): Crash in PreviewLoader::shouldCreateForMIMEType() when a ResourceResponse has a null MIME type
55         https://bugs.webkit.org/show_bug.cgi?id=175548
56         <rdar://problem/33866206>
57
58         Reviewed by Brady Eidson.
59
60         New API test: QuickLook.ShouldCreateForMIMEType
61
62         * WebCore.xcodeproj/project.pbxproj:
63         * loader/ios/PreviewLoader.h:
64         * loader/ios/PreviewLoader.mm:
65         (WebCore::PreviewLoader::shouldCreateForMIMEType): Check if mimeType is a null String before
66         calling HashSet::contains().
67
68 2017-08-14  Andy Estes  <aestes@apple.com>
69
70         [Apple Pay] Add support for phonetic contact names
71         https://bugs.webkit.org/show_bug.cgi?id=175537
72         <rdar://problem/32002644>
73
74         Reviewed by Tim Horton.
75
76         * Modules/applepay/ApplePayError.idl: Defined "phoneticName" in ApplePayErrorContactField.
77         * Modules/applepay/ApplePayPaymentContact.h: Defined phoneticGivenName and phoneticFamilyName
78         in ApplePayPaymentContact.
79         * Modules/applepay/ApplePayPaymentContact.idl: Ditto.
80         * Modules/applepay/ApplePayPaymentRequest.h: Defined PhoneticName in
81         ApplePayPaymentRequest::ContactField.
82         * Modules/applepay/ApplePayPaymentRequest.idl: Defined "phoneticName" in ApplePayContactField.
83         * Modules/applepay/ApplePaySession.cpp:
84         (WebCore::convertAndValidate): Added a version parameter. Added code to convert
85         ContactField::PhoneticName, throwing an exception if version is less than 3.
86         * Modules/applepay/PaymentContact.h: Added a version parameter to fromApplePayPaymentContact().
87         * Modules/applepay/PaymentRequest.h: Defined phoneticName in PaymentRequest::ContactFields
88         and defined PhoneticName in PaymentError::ContactField.
89         * Modules/applepay/cocoa/PaymentContactCocoa.mm:
90         (WebCore::convert): Added a version parameter. Set a phoneticRepresentation on the
91         PKContact's name if there are non-empty phonetic names and version is 3 or greater.
92         (WebCore::PaymentContact::fromApplePayPaymentContact): Passed version to convert().
93
94 2017-08-14  Said Abou-Hallawa  <sabouhallawa@apple.com>
95
96         The none smooth stroke applied to an SVG shape breaks its hit testing
97         https://bugs.webkit.org/show_bug.cgi?id=175506
98
99         Reviewed by Simon Fraser.
100
101         Clear RenderSVGShape::m_path when calling RenderSVGRect::updateShapeFromElement().
102         The m_path will be recalculated when RenderSVGShape::updateShapeFromElement()
103         is called from RenderSVGRect::shapeDependentStrokeContains().
104
105         Test: svg/stroke/stroke-linejoin-click.html
106
107         * rendering/svg/RenderSVGRect.cpp:
108         (WebCore::RenderSVGRect::updateShapeFromElement):
109         * rendering/svg/RenderSVGShape.h:
110         (WebCore::RenderSVGShape::clearPath):
111
112 2017-08-14  Adrian Perez de Castro  <aperez@igalia.com>
113
114         [WPE] Implement WebCore::standardUserAgent()
115         https://bugs.webkit.org/show_bug.cgi?id=175507
116
117         Reviewed by Michael Catanzaro.
118
119         Remove "_GLIB" from user-agent version macros.
120
121         * platform/glib/UserAgentGLib.cpp:
122         (WebCore::versionForUAString):
123
124 2017-08-14  Chris Dumez  <cdumez@apple.com>
125
126         Unreviewed, rollout r220622 & r220696
127         https://bugs.webkit.org/show_bug.cgi?id=175482
128         <rdar://problem/33860695>
129
130         Seems to have caused failures on iOS.
131
132         * CMakeLists.txt:
133         * Modules/beacon/NavigatorBeacon.cpp:
134         (WebCore::NavigatorBeacon::sendBeacon):
135         * Modules/fetch/FetchBodyOwner.cpp:
136         (WebCore::FetchBodyOwner::BlobLoader::didReceiveResponse):
137         (WebCore::FetchBodyOwner::BlobLoader::didFail):
138         * Modules/fetch/FetchBodyOwner.h:
139         * Modules/fetch/FetchLoader.cpp:
140         (WebCore::FetchLoader::start):
141         (WebCore::FetchLoader::didFail):
142         * Modules/fetch/FetchLoaderClient.h:
143         * Modules/fetch/FetchResponse.cpp:
144         (WebCore::FetchResponse::BodyLoader::didFail):
145         * Modules/fetch/FetchResponse.h:
146         * WebCore.xcodeproj/project.pbxproj:
147         * loader/DocumentThreadableLoader.cpp:
148         (WebCore::DocumentThreadableLoader::loadRequest):
149         * loader/cache/CachedRawResource.cpp:
150         (WebCore::CachedRawResource::finishLoading):
151         * loader/cache/CachedResource.cpp:
152         (WebCore::CachedResource::load):
153         * loader/cache/CachedResource.h:
154         (WebCore::CachedResource::isMainOrMediaOrIconOrRawResource const):
155         * loader/cache/CachedResourceLoader.cpp:
156         (WebCore::createResource):
157         (WebCore::CachedResourceLoader::requestImage):
158         (WebCore::CachedResourceLoader::requestFont):
159         (WebCore::CachedResourceLoader::requestTextTrack):
160         (WebCore::CachedResourceLoader::requestCSSStyleSheet):
161         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
162         (WebCore::CachedResourceLoader::requestScript):
163         (WebCore::CachedResourceLoader::requestXSLStyleSheet):
164         (WebCore::CachedResourceLoader::requestSVGDocument):
165         (WebCore::CachedResourceLoader::requestLinkResource):
166         (WebCore::CachedResourceLoader::requestMedia):
167         (WebCore::CachedResourceLoader::requestIcon):
168         (WebCore::CachedResourceLoader::requestRawResource):
169         (WebCore::CachedResourceLoader::requestBeaconResource):
170         (WebCore::CachedResourceLoader::requestMainResource):
171         (WebCore::CachedResourceLoader::requestResource):
172         (WebCore::CachedResourceLoader::preload):
173         * loader/cache/CachedResourceLoader.h:
174         * loader/cache/KeepaliveRequestTracker.cpp: Removed.
175         * loader/cache/KeepaliveRequestTracker.h: Removed.
176         * platform/network/FormData.cpp:
177         (WebCore::FormData::appendFile):
178         (WebCore::FormData::appendFileRange):
179         (WebCore::FormData::appendBlob):
180         (WebCore::FormData::expandDataStore):
181         * platform/network/FormData.h:
182
183 2017-08-14  Daniel Bates  <dabates@apple.com>
184
185         [css-ui] Implement caret-color support
186         https://bugs.webkit.org/show_bug.cgi?id=166572
187         <rdar://problem/33852589>
188
189         Reviewed by David Hyatt.
190
191         Add support for the CSS property caret-color as per <https://www.w3.org/TR/css-ui-3/#caret-color> (02 March 2017).
192         The property caret-color specifies the color of the text insertion caret in an editable element,
193         say an HTML textarea element.
194
195         Unlike other CSS color properties caret-color can have value "auto" and this is its initial
196         value. Internally we treat value "auto" as an invalid caret color to simplify the code.
197
198         Tests: editing/pasteboard/preserve-caret-color.html
199                fast/css/caret-color-auto.html
200                fast/css/caret-color-fallback-to-color.html
201                fast/css/caret-color-inherit.html
202                fast/css/caret-color-span-inside-editable-parent.html
203                fast/css/caret-color.html
204                fast/history/visited-link-caret-color.html
205
206         * css/CSSComputedStyleDeclaration.cpp:
207         (WebCore::ComputedStyleExtractor::propertyValue):
208         * css/CSSProperties.json: Add property caret-color. We represent the initial  "auto" Also, fix up
209         wording in a comment while I am here.
210         * css/StyleResolver.cpp:
211         (WebCore::isValidVisitedLinkProperty): Add caret-color to the list of properties that can be
212         applied to visited hyperlinks.
213         * css/parser/CSSParserFastPaths.cpp:
214         (WebCore::parseCaretColor): Added.
215         (WebCore::CSSParserFastPaths::maybeParseValue): Unlike other CSS color properties caret-color
216         can be defined to be "auto". We explicitly check if the property is caret-color and use
217         parseCaretColor() to parse its value.
218         * css/parser/CSSPropertyParser.cpp:
219         (WebCore::consumeCaretColor): Added.
220         (WebCore::CSSPropertyParser::parseSingleValue): Similar to the change to CSSParserFastPaths::maybeParseValue()
221         use a dedicated code path to parse caret-color.
222         * editing/EditingStyle.cpp: Preserve caret-color during editing operations.
223         * editing/FrameSelection.cpp:
224         (WebCore::CaretBase::paintCaret const): Modified code to query property caret-color instead of
225         color for the color of the text insertion caret. Always honor the caret-color of the editable
226         element if it is valid color. Note that "caret-color: auto" is treated as an invalid color
227         internally. A caret-color can have an invalid color if its inherits from the CSS color property
228         with an invalid color. If caret-color is a valid color then we take it to be the color of the
229         text insertion caret. Otherwise, we do what we do today and use a heuristic to determine the
230         color of the text-insertion caret.
231         (WebCore::disappearsIntoBackground): Deleted; moved logic into CaretBase::paintCaret().
232         * page/animation/CSSPropertyAnimation.cpp:
233         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap): Add property wrapper
234         to support animating caret-color.
235         * rendering/style/RenderStyle.cpp:
236         (WebCore::RenderStyle::changeRequiresRepaintIfTextOrBorderOrOutline const): Modified to consider
237         changes to caret color.
238         (WebCore::RenderStyle::colorIncludingFallback const): Modified to compute the appropriate
239         color for property caret-color with respect to an unvisited or visited link.
240         * rendering/style/RenderStyle.h:
241         (WebCore::RenderStyle::setCaretColor): Added.
242         (WebCore::RenderStyle::setVisitedLinkCaretColor): Added.
243         (WebCore::RenderStyle::caretColor const): Added.
244         (WebCore::RenderStyle::visitedLinkCaretColor const): Added.
245         * rendering/style/StyleRareInheritedData.cpp:
246         (WebCore::StyleRareInheritedData::StyleRareInheritedData): Modified to consider caret color.
247         (WebCore::StyleRareInheritedData::operator== const): Ditto.
248         * rendering/style/StyleRareInheritedData.h:
249
250 2017-08-14  Zan Dobersek  <zdobersek@igalia.com>
251
252         REGRESSION(r220517-r220521) [GTK] Various compositing tests fail
253         https://bugs.webkit.org/show_bug.cgi?id=175478
254
255         Reviewed by Sergio Villar Senin.
256
257         Fix a regression introduced in r220519. Move a framebuffer binding in TextureMapperGL
258         away from GraphicsContext3D and onto the OpenGL API to work around the framebuffer
259         binding state that's kept in the GraphicsContext3D class. This mismatch in how the
260         framebuffer was bound was causing a couple of test failures in compositing tests.
261
262         No new tests -- regressed tests have their failure expectations removed.
263
264         * platform/graphics/texmap/TextureMapperGL.cpp:
265         (WebCore::TextureMapperGL::bindDefaultSurface): Don't use GraphicsContext3D for the
266         glBindFramebuffer() call. This would be done in subsequent patches that would move
267         TextureMapperGL off the GraphicsContext3D usage, but this specific use case clashes
268         with the framebuffer binding that's done in BitmapTextureGL and was causing test
269         failures.
270
271 2017-08-14  Chris Dumez  <cdumez@apple.com>
272
273         Unreviewed fix after r220622 to address crashes on iOS.
274
275         * loader/cache/CachedRawResource.cpp:
276         (WebCore::CachedRawResource::finishLoading):
277
278 2017-08-14  Antti Koivisto  <antti@apple.com>
279
280         Factor text autosizing into a class
281         https://bugs.webkit.org/show_bug.cgi?id=175530
282
283         Reviewed by Andreas Kling.
284
285         Move the remaining parts out of Document.
286
287         * css/StyleBuilderCustom.h:
288         (WebCore::computeLineHeightMultiplierDueToFontSize):
289         * dom/Document.cpp:
290         (WebCore::Document::destroyRenderTree):
291         (WebCore::Document::textAutoSizing):
292         (WebCore::TextAutoSizingTraits::constructDeletedValue): Deleted.
293         (WebCore::TextAutoSizingTraits::isDeletedValue): Deleted.
294         (WebCore::Document::addAutoSizedNode): Deleted.
295         (WebCore::Document::updateAutoSizedNodes): Deleted.
296         (WebCore::Document::clearAutoSizedNodes): Deleted.
297         * dom/Document.h:
298         * rendering/RenderBlockFlow.cpp:
299         (WebCore::RenderBlockFlow::adjustComputedFontSizes):
300         * rendering/RenderElement.cpp:
301         (WebCore::RenderElement::adjustComputedFontSizesOnBlocks):
302         (WebCore::RenderElement::resetTextAutosizing):
303         * rendering/TextAutoSizing.cpp:
304         (WebCore::TextAutoSizingTraits::constructDeletedValue):
305         (WebCore::TextAutoSizingTraits::isDeletedValue):
306         (WebCore::TextAutoSizing::addTextNode):
307         (WebCore::TextAutoSizing::updateRenderTree):
308         (WebCore::TextAutoSizing::reset):
309         * rendering/TextAutoSizing.h:
310
311 2017-08-14  Antti Koivisto  <antti@apple.com>
312
313         [Render Tree Mutation] First letter should not mutate the render tree while in layout.
314         https://bugs.webkit.org/show_bug.cgi?id=163848
315
316         Reviewed by Zalan Bujtas.
317
318         RenderBlock::updateFirstLetter shouldn't be called during layout. Instead it should
319         be invoked by the RenderTreeUpdater.
320
321         With this future patches can move updateFirstLetter() and the related functions
322         completely out of the render tree.
323
324         * rendering/RenderBlock.cpp:
325         (WebCore::RenderBlock::layout):
326
327             No more updateFirstLetter calls during layout...
328
329         (WebCore::RenderBlock::computePreferredLogicalWidths):
330
331             ...or preferred width computation.
332
333         (WebCore::RenderBlock::updateFirstLetter):
334         * rendering/RenderBlock.h:
335         * rendering/RenderRubyRun.cpp:
336         (WebCore::RenderRubyRun::updateFirstLetter):
337         * rendering/RenderRubyRun.h:
338         * rendering/RenderTable.cpp:
339         (WebCore::RenderTable::updateFirstLetter):
340         * rendering/RenderTable.h:
341         * rendering/svg/RenderSVGText.cpp:
342         (WebCore::RenderSVGText::updateFirstLetter):
343         * rendering/svg/RenderSVGText.h:
344         * style/RenderTreeUpdater.cpp:
345         (WebCore::RenderTreeUpdater::popParent):
346
347             Call updateFirstLetter when closing the element. All of of descedant renderers are known here
348             so this can be resolved correctly.
349
350 2017-08-13  Manuel Rego Casasnovas  <rego@igalia.com>
351
352         Composition underline color is always black
353         https://bugs.webkit.org/show_bug.cgi?id=174675
354
355         Reviewed by Ryosuke Niwa.
356
357         This patch uses the current color of the text instead of black
358         for the composition underline marker.
359         This makes it visible in the case we have a black/dark background.
360
361         Test: editing/composition-underline-color.html
362
363         * editing/CompositionUnderline.h:
364         (WebCore::CompositionUnderline::CompositionUnderline):
365         Added new attribute compositionUnderlineColor.
366         * rendering/InlineTextBox.cpp:
367         (WebCore::InlineTextBox::paintCompositionUnderline):
368         Use the text color if compositionUnderlineColor is TextColor.
369
370 2017-08-13  Carlos Garcia Campos  <cgarcia@igalia.com>
371
372         [GTK] stop kinetic scrolling when a zero movement is reached
373         https://bugs.webkit.org/show_bug.cgi?id=175468
374
375         Reviewed by Michael Catanzaro.
376
377         This is GTK+ change by Christian Hergert.
378         https://git.gnome.org/browse/gtk+/commit/?h=gtk-3-22&id=4f63d839550f7a9038b391e7d3e1e6fc8bdfafa6
379
380         When the kinetic scrolling reduces its speed, there can be multiple frames where the movement is zero pixels,
381         followed by a 1 pixel movement later on. This causes a "jitter" right at the end of the scroll which makes it
382         feel less quality than other platforms. Instead, we should just clamp it as soon as we get a zero movement.
383
384         * platform/ScrollAnimationKinetic.cpp:
385         (WebCore::ScrollAnimationKinetic::PerAxisData::animateScroll):
386
387 2017-08-13  Chris Dumez  <cdumez@apple.com>
388
389         Drop non-const getter for CachedResource::resourceRequest()
390         https://bugs.webkit.org/show_bug.cgi?id=175524
391
392         Reviewed by Youenn Fablet.
393
394         Drop non-const getter for CachedResource::resourceRequest(). It would be unsafe to modify the request of a CachedResource
395         after it has been cached. Exposing such a getter is therefore a footgun.
396
397         * loader/LinkLoader.cpp:
398         (WebCore::LinkLoader::preloadIfNeeded):
399         * loader/cache/CachedImage.cpp:
400         (WebCore::CachedImage::CachedImage):
401         * loader/cache/CachedImage.h:
402         * loader/cache/CachedResource.cpp:
403         (WebCore::CachedResource::CachedResource):
404         * loader/cache/CachedResource.h:
405         (WebCore::CachedResource::resourceRequest const):
406         (WebCore::CachedResource::ignoreForRequestCount const):
407         (WebCore::CachedResource::setIgnoreForRequestCount):
408         * loader/cache/CachedResourceLoader.cpp:
409         (WebCore::CachedResourceLoader::requestResource):
410         * loader/cache/CachedResourceRequest.h:
411         (WebCore::CachedResourceRequest::ignoreForRequestCount const):
412         (WebCore::CachedResourceRequest::setIgnoreForRequestCount):
413         * loader/cache/MemoryCache.cpp:
414         (WebCore::MemoryCache::addImageToCache):
415         * platform/network/ResourceRequestBase.h:
416
417 2017-08-13  Adrian Perez de Castro  <aperez@igalia.com>
418
419         [WPE] Implement WebCore::standardUserAgent()
420         https://bugs.webkit.org/show_bug.cgi?id=175507
421
422         Reviewed by Carlos Alberto Lopez Perez.
423
424         Implement missing User-Agent handling for the WPE port by sharing the code with the GTK+ port.
425
426         * PlatformGTK.cmake: Handlde renaming of UserAgentGtk.cpp to UserAgentGLib.cpp.
427         * PlatformWPE.cmake: Add UserAgentGLib.cpp and UserAgentQuirks.cpp to the list of built WebCore sources.
428         * platform/glib/UserAgentGLib.cpp: Renamed from Source/WebCore/platform/gtk/UserAgentGtk.cpp.
429         (WebCore::versionForUAString): Change "GTK" in UA version macros to "GLIB".
430
431 2017-08-11  Ryosuke Niwa  <rniwa@webkit.org>
432
433         Replace DATA_TRANSFER_ITEMS by a runtime flag and add a stub implementation
434         https://bugs.webkit.org/show_bug.cgi?id=175474
435         <rdar://problem/33844628>
436
437         Reviewed by Wenson Hsieh.
438
439         Replaced the build flag by a runtime flag and added a stub implementation for DataTransferItemList
440         and DataTransferItem to make it compile. DataTransferItemList is created lazily by DataTransfer.items,
441         and its lifetime is tied to DataTransfer by forwarding ref and deref.
442
443         See https://html.spec.whatwg.org/multipage/dnd.html#the-datatransferitemlist-interface
444
445         Tests: editing/pasteboard/datatransfer-idl.html
446
447         * CMakeLists.txt:
448         * Configurations/FeatureDefines.xcconfig:
449         * WebCore.xcodeproj/project.pbxproj:
450         * dom/DataTransfer.cpp:
451         (WebCore::DataTransfer::items): Added. Create DataTransferItemList lazily
452         * dom/DataTransfer.h:
453         * dom/DataTransfer.idl:
454         * dom/DataTransferItem.cpp:
455         (WebCore::DataTransferItem::DataTransferItem): Added a stub implementation.
456         (WebCore::DataTransferItem::~DataTransferItem): Ditto.
457         (WebCore::DataTransferItem::getAsString const): Ditto.
458         (WebCore::DataTransferItem::getAsFile const): Ditto.
459         * dom/DataTransferItem.h:
460         (WebCore::DataTransferItemList): Devirtualized functions.
461         (WebCore::DataTransferItemList::kind const):
462         (WebCore::DataTransferItemList::type const):
463         * dom/DataTransferItem.idl:
464         * dom/DataTransferItemList.cpp: Added.
465         (WebCore::DataTransferItemList::length const): Added a stub implementation.
466         (WebCore::DataTransferItemList::item): Ditto.
467         (WebCore::DataTransferItemList::add): Ditto.
468         (WebCore::DataTransferItemList::remove): Ditto.
469         (WebCore::DataTransferItemList::clear): Ditto.
470         * dom/DataTransferItemList.h:
471         (WebCore::DataTransferItemList::DataTransferItemList):
472         (WebCore::DataTransferItemList::~DataTransferItemList): Deleted.
473         (WebCore::DataTransferItemList::ref): Forwards to DataTransfer's ref.
474         (WebCore::DataTransferItemList::deref): Ditto.
475         * dom/DataTransferItemList.idl: Updated to match the latest specification.
476         * page/RuntimeEnabledFeatures.h:
477         (WebCore::RuntimeEnabledFeatures::setDataTransferItemsEnabled): Added.
478         (WebCore::RuntimeEnabledFeatures::dataTransferItemsEnabled const): Added.
479
480 2017-08-11  Brady Eidson  <beidson@apple.com>
481
482         Move files inside WebCore/workers to WebCore/workers/service.
483         https://bugs.webkit.org/show_bug.cgi?id=175495
484
485         Rubberstamped by Tim Horton.
486
487         * CMakeLists.txt:
488         * DerivedSources.make:
489         * WebCore.xcodeproj/project.pbxproj:
490
491         * workers/service/ServiceWorker.cpp: Renamed from Source/WebCore/workers/ServiceWorker.cpp.
492         * workers/service/ServiceWorker.h: Renamed from Source/WebCore/workers/ServiceWorker.h.
493         * workers/service/ServiceWorker.idl: Renamed from Source/WebCore/workers/ServiceWorker.idl.
494         * workers/service/ServiceWorkerContainer.cpp: Renamed from Source/WebCore/workers/ServiceWorkerContainer.cpp.
495         * workers/service/ServiceWorkerContainer.h: Renamed from Source/WebCore/workers/ServiceWorkerContainer.h.
496         * workers/service/ServiceWorkerContainer.idl: Renamed from Source/WebCore/workers/ServiceWorkerContainer.idl.
497         * workers/service/ServiceWorkerGlobalScope.cpp: Renamed from Source/WebCore/workers/ServiceWorkerGlobalScope.cpp.
498         * workers/service/ServiceWorkerGlobalScope.h: Renamed from Source/WebCore/workers/ServiceWorkerGlobalScope.h.
499         * workers/service/ServiceWorkerGlobalScope.idl: Renamed from Source/WebCore/workers/ServiceWorkerGlobalScope.idl.
500         * workers/service/ServiceWorkerJob.cpp: Renamed from Source/WebCore/workers/ServiceWorkerJob.cpp.
501         * workers/service/ServiceWorkerJob.h: Renamed from Source/WebCore/workers/ServiceWorkerJob.h.
502         * workers/service/ServiceWorkerJobClient.h: Renamed from Source/WebCore/workers/ServiceWorkerJobClient.h.
503         * workers/service/ServiceWorkerProvider.cpp: Renamed from Source/WebCore/workers/ServiceWorkerProvider.cpp.
504         * workers/service/ServiceWorkerProvider.h: Renamed from Source/WebCore/workers/ServiceWorkerProvider.h.
505         * workers/service/ServiceWorkerRegistration.cpp: Renamed from Source/WebCore/workers/ServiceWorkerRegistration.cpp.
506         * workers/service/ServiceWorkerRegistration.h: Renamed from Source/WebCore/workers/ServiceWorkerRegistration.h.
507         * workers/service/ServiceWorkerRegistration.idl: Renamed from Source/WebCore/workers/ServiceWorkerRegistration.idl.
508         * workers/service/ServiceWorkerRegistrationOptions.h: Renamed from Source/WebCore/workers/ServiceWorkerRegistrationOptions.h.
509         * workers/service/ServiceWorkerRegistrationParameters.cpp: Renamed from Source/WebCore/workers/ServiceWorkerRegistrationParameters.cpp.
510         * workers/service/ServiceWorkerRegistrationParameters.h: Renamed from Source/WebCore/workers/ServiceWorkerRegistrationParameters.h.
511         * workers/service/ServiceWorkerUpdateViaCache.h: Renamed from Source/WebCore/workers/ServiceWorkerUpdateViaCache.h.
512         * workers/service/ServiceWorkerUpdateViaCache.idl: Renamed from Source/WebCore/workers/ServiceWorkerUpdateViaCache.idl.
513
514 2017-08-11  Chris Dumez  <cdumez@apple.com>
515
516         Implement quota limitation for keepalive Fetch requests
517         https://bugs.webkit.org/show_bug.cgi?id=175482
518
519         Reviewed by Sam Weinig and Youenn Fablet.
520
521         Implement quota limitation for keepalive Fetch requests as per:
522         - https://fetch.spec.whatwg.org/#http-network-or-cache-fetch (Step 9)
523
524         This partly works for Beacon as well, meaning that no Beacon with a body
525         over 64Kb can be sent. However, we don't keep track about wether or not
526         beacon loads are inflight or not.
527
528         Also update CachedResourceLoader::requestResource() so that the caller
529         can get a ResourceError when it returns null. This is useful for both
530         Fetch and Beacon to return better error messages.
531
532         Test: http/wpt/beacon/beacon-quota.html
533
534         * CMakeLists.txt:
535         * Modules/beacon/NavigatorBeacon.cpp:
536         (WebCore::NavigatorBeacon::sendBeacon):
537         * Modules/fetch/FetchBodyOwner.cpp:
538         (WebCore::FetchBodyOwner::BlobLoader::didReceiveResponse):
539         (WebCore::FetchBodyOwner::BlobLoader::didFail):
540         * Modules/fetch/FetchBodyOwner.h:
541         * Modules/fetch/FetchLoader.cpp:
542         (WebCore::FetchLoader::start):
543         (WebCore::FetchLoader::didFail):
544         * Modules/fetch/FetchLoaderClient.h:
545         * Modules/fetch/FetchResponse.cpp:
546         (WebCore::FetchResponse::BodyLoader::didFail):
547         * Modules/fetch/FetchResponse.h:
548         * WebCore.xcodeproj/project.pbxproj:
549         * loader/DocumentThreadableLoader.cpp:
550         (WebCore::DocumentThreadableLoader::loadRequest):
551         * loader/cache/CachedResource.cpp:
552         (WebCore::CachedResource::load):
553         * loader/cache/CachedResource.h:
554         (WebCore::CachedResource::isMainOrMediaOrIconOrRawResource const):
555         * loader/cache/CachedResourceLoader.cpp:
556         (WebCore::createResource):
557         (WebCore::CachedResourceLoader::requestImage):
558         (WebCore::CachedResourceLoader::requestFont):
559         (WebCore::CachedResourceLoader::requestTextTrack):
560         (WebCore::CachedResourceLoader::requestCSSStyleSheet):
561         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
562         (WebCore::CachedResourceLoader::requestScript):
563         (WebCore::CachedResourceLoader::requestXSLStyleSheet):
564         (WebCore::CachedResourceLoader::requestSVGDocument):
565         (WebCore::CachedResourceLoader::requestLinkResource):
566         (WebCore::CachedResourceLoader::requestMedia):
567         (WebCore::CachedResourceLoader::requestIcon):
568         (WebCore::CachedResourceLoader::requestRawResource):
569         (WebCore::CachedResourceLoader::requestBeaconResource):
570         (WebCore::CachedResourceLoader::requestMainResource):
571         (WebCore::CachedResourceLoader::requestResource):
572         (WebCore::CachedResourceLoader::preload):
573         * loader/cache/CachedResourceLoader.h:
574         * loader/cache/KeepaliveRequestTracker.cpp: Added.
575         (WebCore::KeepaliveRequestTracker::~KeepaliveRequestTracker):
576         (WebCore::KeepaliveRequestTracker::canLoadRequest):
577         (WebCore::KeepaliveRequestTracker::registerRequest):
578         (WebCore::KeepaliveRequestTracker::responseReceived):
579         (WebCore::KeepaliveRequestTracker::notifyFinished):
580         (WebCore::KeepaliveRequestTracker::unregisterRequest):
581         * loader/cache/KeepaliveRequestTracker.h: Added.
582         * platform/network/FormData.cpp:
583         (WebCore::FormDataElement::lengthInBytes const):
584         (WebCore::FormData::lengthInBytes const):
585         * platform/network/FormData.h:
586
587 2017-08-11  Don Olmstead  <don.olmstead@sony.com>
588
589         [WTF] Move ValueToString into WTF
590         https://bugs.webkit.org/show_bug.cgi?id=175469
591
592         Reviewed by Sam Weinig.
593
594         No new tests. No change in behavior.
595
596         * WebCore.xcodeproj/project.pbxproj:
597         * html/HTMLMediaElement.h:
598         (WTF::ValueToString<WebCore::TextTrackCue::string):
599         (WebCore::ValueToString<TextTrackCue::string): Deleted.
600         (WebCore::ValueToString<MediaTime>::string): Deleted.
601         * platform/LayoutUnit.h:
602         (WTF::ValueToString<WebCore::LayoutUnit>::string):
603         (WebCore::ValueToString<LayoutUnit>::string): Deleted.
604         * platform/PODInterval.h:
605         * platform/PODIntervalTree.h:
606         * platform/PODRedBlackTree.h:
607         * platform/graphics/FloatPolygon.h:
608         (WTF::ValueToString<WebCore::FloatPolygonEdge::string):
609         (WebCore::ValueToString<FloatPolygonEdge::string): Deleted.
610         * rendering/FloatingObjects.h:
611         (WTF::ValueToString<WebCore::FloatingObject::string):
612         (WebCore::ValueToString<FloatingObject::string): Deleted.
613         * rendering/RenderFlowThread.h:
614         (WTF::ValueToString<WebCore::RenderRegion::string):
615         (WebCore::ValueToString<RenderRegion::string): Deleted.
616
617 2017-08-11  Sam Weinig  <sam@webkit.org>
618
619         [Bindings] Simplify DOMPromiseProxy now that WTF::Function can return references
620         https://bugs.webkit.org/show_bug.cgi?id=175394
621
622         Reviewed by Chris Dumez.
623
624         * bindings/IDLTypes.h:
625         (WebCore::IDLWrapper::convertToParameterType): Deleted.
626
627             Remove no longer used convertToParameterType.
628
629         * bindings/js/DOMPromiseProxy.h:
630
631             - Replace Variant<Value, Exception> with ExceptionOr<Value> / ExceptionOr<void>.
632             - Update ResolveCallback to have a return type of IDLType::ParameterType, rather than
633               IDLType::ImplementationType, now that WTF::Function supports references as the 
634               return type. This is needed, since the IDLType::ParameterType for an interface T
635               is T&.
636
637         * css/FontFace.cpp:
638         * css/FontFace.h:
639         * css/FontFaceSet.cpp:
640         * css/FontFaceSet.h:
641
642             Update resolve callbacks to return a reference rather than a RefPtr, matching
643             the new signature requirement.
644
645 2017-08-11  Sam Weinig  <sam@webkit.org>
646
647         [WebIDL] Replace JSCryptoKeyCustom and JSCryptoAlgorithmBuilder with generated code
648         https://bugs.webkit.org/show_bug.cgi?id=175457
649
650         Reviewed by Chris Dumez.
651
652         * CMakeLists.txt:
653         * DerivedSources.make:
654         * WebCore.xcodeproj/project.pbxproj:
655         * bindings/js/JSCryptoAlgorithmBuilder.cpp: Removed.
656         * bindings/js/JSCryptoAlgorithmBuilder.h: Removed.
657         * bindings/js/JSCryptoKeyCustom.cpp: Removed.
658
659             Remove JSCryptoAlgorithmBuilder and JSCryptoKeyCustom, add KeyAlgorithm
660             IDLs and headers.
661
662         * crypto/CryptoKey.cpp:
663         * crypto/CryptoKey.h:
664         * crypto/CryptoKey.idl:
665         
666             Replace custom algorithm attribute with a union of the supported key algorithms.
667         
668         * crypto/keys/CryptoAesKeyAlgorithm.h: Added.
669         * crypto/keys/CryptoAesKeyAlgorithm.idl: Added.
670         * crypto/keys/CryptoEcKeyAlgorithm.h: Added.
671         * crypto/keys/CryptoEcKeyAlgorithm.idl: Added.
672         * crypto/keys/CryptoHmacKeyAlgorithm.h: Added.
673         * crypto/keys/CryptoHmacKeyAlgorithm.idl: Added.
674         * crypto/keys/CryptoKeyAlgorithm.h: Added.
675         * crypto/keys/CryptoKeyAlgorithm.idl: Added.
676         * crypto/keys/CryptoRsaHashedKeyAlgorithm.h: Added.
677         * crypto/keys/CryptoRsaHashedKeyAlgorithm.idl: Added.
678         * crypto/keys/CryptoRsaKeyAlgorithm.h: Added.
679         * crypto/keys/CryptoRsaKeyAlgorithm.idl: Added.
680
681             Add IDLs and headers fo the supported key algorithms.
682
683         * crypto/keys/CryptoKeyAES.h:
684         * crypto/keys/CryptoKeyEC.h:
685         * crypto/keys/CryptoKeyHMAC.h:
686         * crypto/keys/CryptoKeyRSA.h:
687         * crypto/keys/CryptoKeyRaw.h:
688
689             Give each of the existing KeyAlgorithm subclasses a dictionary() function
690             that returns the populated corresponding spec'd dictionary.
691
692 2017-08-11  Simon Fraser  <simon.fraser@apple.com>
693
694         Some RenderSVGResource cleanup
695         https://bugs.webkit.org/show_bug.cgi?id=175494
696
697         Reviewed by Zalan Bujtas.
698
699         Use more initializers. Remove spurious use of bitfields that didn't save any space at all.
700         0 -> nullptr.
701
702         No behavior change.
703
704         * rendering/svg/RenderSVGResourceContainer.cpp:
705         (WebCore::RenderSVGResourceContainer::RenderSVGResourceContainer):
706         * rendering/svg/RenderSVGResourceContainer.h:
707         * rendering/svg/RenderSVGResourceGradient.cpp:
708         (WebCore::RenderSVGResourceGradient::RenderSVGResourceGradient):
709         (WebCore::RenderSVGResourceGradient::applyResource):
710         * rendering/svg/RenderSVGResourceGradient.h:
711         * rendering/svg/RenderSVGResourcePattern.cpp:
712         (WebCore::RenderSVGResourcePattern::RenderSVGResourcePattern):
713         * rendering/svg/RenderSVGResourcePattern.h:
714         * rendering/svg/RenderSVGShape.cpp:
715         (WebCore::RenderSVGShape::fillShape):
716         (WebCore::RenderSVGShape::strokeShape):
717         * rendering/svg/SVGRenderingContext.cpp:
718         (WebCore::SVGRenderingContext::~SVGRenderingContext):
719         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
720         * rendering/svg/SVGRenderingContext.h:
721         (WebCore::SVGRenderingContext::SVGRenderingContext):
722
723 2017-08-11  Tim Horton  <timothy_horton@apple.com>
724
725         Fix the build with modern Clang's -Wexpansion-to-defined
726         https://bugs.webkit.org/show_bug.cgi?id=175467
727         <rdar://problem/33667497>
728
729         Reviewed by Simon Fraser.
730
731         * crypto/mac/SerializedCryptoKeyWrapMac.mm:
732
733 2017-08-11  Brady Eidson  <beidson@apple.com>
734
735         Crash under ServiceWorkerJob::failedWithException.
736         https://bugs.webkit.org/show_bug.cgi?id=175488
737
738         Reviewed by Tim Horton.
739
740         Covered by existing tests.
741
742         * workers/ServiceWorkerJob.cpp:
743         (WebCore::ServiceWorkerJob::failedWithException): jobDidFinish might cause the Job to be deleted, so make it last.
744
745 2017-08-10  Sam Weinig  <sam@webkit.org>
746
747         WTF::Function does not allow for reference / non-default constructible return types
748         https://bugs.webkit.org/show_bug.cgi?id=175244
749
750         Reviewed by Chris Dumez.
751
752         * bindings/js/JSCustomElementInterface.h:
753         (WebCore::JSCustomElementInterface::invokeCallback):
754         Update the default value for the addArguments parameter to be an empty lambda, rather than
755         default initialization, which leads to a null WTF::Function. This allows us to remove support
756         for calling null WTF::Function. No change in behavior.
757
758 2017-08-11  Antti Koivisto  <antti@apple.com>
759
760         Remove RenderQuote collection from RenderView
761         https://bugs.webkit.org/show_bug.cgi?id=175479
762
763         Reviewed by Andreas Kling.
764
765         We can do it well enough without maintaining this pointer structure.
766
767         Global updating doesn't work well with future direction for first-letter and similar anyway.
768         We need to update quote immediately when updating its style.
769
770         * rendering/RenderQuote.cpp:
771         (WebCore::RenderQuote::insertedIntoTree):
772         (WebCore::RenderQuote::willBeRemovedFromTree):
773
774             Just tell the view that there are renderers to update.
775
776         (WebCore::RenderQuote::styleDidChange):
777         (WebCore::RenderQuote::isOpen const):
778         (WebCore::RenderQuote::updateRenderer):
779         (WebCore::RenderQuote::updateRenderers): Deleted.
780
781             Update single renderer only. RenderTreeUpdater provides the previous renderer to compute the depth.
782
783         * rendering/RenderQuote.h:
784         * rendering/RenderView.cpp:
785         (WebCore::RenderView::registerQuote): Deleted.
786         (WebCore::RenderView::unregisterQuote): Deleted.
787         (WebCore::RenderView::updateSpecialRenderers): Deleted.
788
789             Remove the quote list.
790
791         * rendering/RenderView.h:
792         * style/RenderTreeUpdater.cpp:
793         (WebCore::RenderTreeUpdater::commit):
794
795             Ensure that all quotes are updated.
796
797         (WebCore::RenderTreeUpdater::updateBeforeOrAfterPseudoElement):
798         (WebCore::RenderTreeUpdater::updateQuotesUpTo):
799
800             Traverse render tree to find quotes to update starting from the previous updated quote.
801
802         * style/RenderTreeUpdater.h:
803
804 2017-08-11  Adrian Perez de Castro  <aperez@igalia.com>
805
806         [CMake] Many warning about missing “override” keywords in ANGLE with Clang
807         https://bugs.webkit.org/show_bug.cgi?id=175475
808
809         Reviewed by Michael Catanzaro.
810
811         * CMakeLists.txt: Add "-Wno-inconsistent-missing-override" to the
812         compiler flags using for building the ANGLE sources.
813
814 2017-08-11  Adrian Perez de Castro  <aperez@igalia.com>
815
816         [GTK][WPE] Overriden virtual function not marked “override” in ImageBufferDataCairo.h
817         https://bugs.webkit.org/show_bug.cgi?id=175476
818
819         Reviewed by Carlos Garcia Campos.
820
821         * platform/graphics/cairo/ImageBufferDataCairo.h: Add missing "override" qualifier.
822
823 2017-08-11  Carlos Garcia Campos  <cgarcia@igalia.com>
824
825         [Soup] Cannot access HTTPS sites using a HTTP proxy that requires authentication
826         https://bugs.webkit.org/show_bug.cgi?id=175378
827
828         Reviewed by Sergio Villar Senin.
829
830         Bring back part of the code removed in r206732, to keep a reference to the SoupMessage in the
831         AuthenticationChallenge since it can be different to the resource message.
832
833         * platform/network/soup/AuthenticationChallenge.h:
834         (WebCore::AuthenticationChallenge::AuthenticationChallenge): Deleted.
835         (WebCore::AuthenticationChallenge::authenticationClient const): Deleted.
836         (WebCore::AuthenticationChallenge::soupAuth const): Deleted.
837         (WebCore::AuthenticationChallenge::setProposedCredential): Deleted.
838         * platform/network/soup/AuthenticationChallengeSoup.cpp:
839         (WebCore::AuthenticationChallenge::AuthenticationChallenge):
840         (WebCore::AuthenticationChallenge::platformCompare):
841
842 2017-08-10  Dan Bernstein  <mitz@apple.com>
843
844         Fixed building for macOS 10.12 with the macOS 10.13 SDK.
845
846         Suppressed the unguarded-availability-new warning around uses of AVSampleBufferAudioRenderer
847         and AVSampleBufferRenderSynchronizer. Even though the 10.13 SDK declares them as available
848         starting in that release, they have been available as SPI earlier.
849
850         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
851         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
852         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
853         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableAudioSample):
854         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addAudioRenderer):
855         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeAudioRenderer):
856         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
857         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
858         (-[WebAVSampleBufferErrorListener beginObservingRenderer:]):
859         (-[WebAVSampleBufferErrorListener stopObservingRenderer:]):
860         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
861         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
862         (WebCore::SourceBufferPrivateAVFObjC::rendererDidReceiveError):
863         (WebCore::SourceBufferPrivateAVFObjC::flush):
864
865 2017-08-10  Brady Eidson  <beidson@apple.com>
866
867         Rename the source files for the WTF persistent coders.
868         https://bugs.webkit.org/show_bug.cgi?id=175441
869
870         Reviewed by Tim Horton.
871
872         * platform/network/NetworkLoadMetrics.h:
873
874 2017-08-10  Yusuke Suzuki  <utatane.tea@gmail.com>
875
876         Make ThreadGlobalData RefCounted for web thread
877         https://bugs.webkit.org/show_bug.cgi?id=175439
878
879         Reviewed by Mark Lam.
880
881         When the web thread is enabled, we share ThreadGlobalData between the web thread and the main thread.
882         The problem happens when the main thread is dying. It could start deallocating TLS and the web
883         thread may see the destructed ThreadGlobalData.
884
885         Even though, the current implementation is safe because the main thread do not perform TLS deallocation
886         in the Darwin environment. But this is not true in Windows. And we should not rely on this condition
887         that depends on the platforms.
888
889         In this patch, we make ThreadGlobalData ThreadSafeRefCounted. This type verbosely describes that
890         ThreadGlobalData could be shared between threads when the web thread enabled. And make the life time
891         management simple instead of relying on the platform dependent TLS implementation.
892
893         * platform/ThreadGlobalData.cpp:
894         (WebCore::ThreadGlobalData::setWebCoreThreadData):
895         (WebCore::threadGlobalData):
896         * platform/ThreadGlobalData.h:
897         (WebCore::ThreadGlobalData::cachedResourceRequestInitiators): Deleted.
898         (WebCore::ThreadGlobalData::eventNames): Deleted.
899         (WebCore::ThreadGlobalData::threadTimers): Deleted.
900         (WebCore::ThreadGlobalData::qualifiedNameCache): Deleted.
901         (WebCore::ThreadGlobalData::cachedConverterICU): Deleted.
902         (WebCore::ThreadGlobalData::cachedConverterTEC): Deleted.
903
904 2017-08-10  Yusuke Suzuki  <utatane.tea@gmail.com>
905
906         [JSC] Use @toNumber in builtins
907         https://bugs.webkit.org/show_bug.cgi?id=172692
908
909         Reviewed by Sam Weinig.
910
911         Use @toNumber bytecode intrinsic. It emits op_to_number, which efficiently converts
912         a given argument to a number.
913
914         * Modules/streams/ReadableByteStreamInternals.js:
915         (privateInitializeReadableByteStreamController):
916         (readableByteStreamControllerRespond):
917         * Modules/streams/StreamInternals.js:
918         (validateAndNormalizeQueuingStrategy):
919         (enqueueValueWithSize):
920
921 2017-08-10  Nan Wang  <n_wang@apple.com>
922
923         AX: crash at WebCore::AccessibilityObject::supportsARIALiveRegion() const + 24
924         https://bugs.webkit.org/show_bug.cgi?id=175340
925         <rdar://problem/33782159>
926
927         Reviewed by Chris Fleizach.
928
929         The issue here is that we manualy set the parent object of the AccessibilitySVGRoot object
930         and there are chances that the parent doesn't detach it properly during the parent's destroying
931         process. Accessing the stale parent object will lead to a crash.
932         Fixed this by making the parent object a weak pointer so we don't access an invalid memory. 
933
934         Test: accessibility/add-children-pseudo-element.html
935
936         * accessibility/AccessibilityRenderObject.cpp:
937         (WebCore::AccessibilityRenderObject::AccessibilityRenderObject):
938         * accessibility/AccessibilityRenderObject.h:
939         (WebCore::AccessibilityRenderObject::createWeakPtr):
940         * accessibility/AccessibilitySVGRoot.cpp:
941         (WebCore::AccessibilitySVGRoot::AccessibilitySVGRoot):
942         (WebCore::AccessibilitySVGRoot::setParent):
943         (WebCore::AccessibilitySVGRoot::parentObject const):
944         * accessibility/AccessibilitySVGRoot.h:
945
946 2017-08-10  Chris Dumez  <cdumez@apple.com>
947
948         [Beacon] Do connect-src CSP check on redirects as well
949         https://bugs.webkit.org/show_bug.cgi?id=175410
950         <rdar://problem/33815470>
951
952         Reviewed by Youenn Fablet.
953
954         Pass ContentSecurityPolicy object to createPingHandle so that we can send
955         enough data to the NetworkProcess so do CSP checks for Ping loads such
956         as Beacon. For the IPC, we serialize the ContentSecurityPolicy's response
957         headers. Those headers are now cached in ContentSecurityPolicy for
958         performance reasons. CSP headers are rarely updated in practice but
959         sendBeacon() may get called repeatedly for a given document.
960
961         Tests: http/wpt/beacon/connect-src-beacon-redirect-allowed.sub.html
962                http/wpt/beacon/connect-src-beacon-redirect-blocked.sub.html
963
964         * loader/LoaderStrategy.h:
965         * loader/PingLoader.cpp:
966         (WebCore::PingLoader::loadImage):
967         (WebCore::PingLoader::sendPing):
968         (WebCore::PingLoader::sendViolationReport):
969         (WebCore::PingLoader::startPingLoad):
970         * loader/PingLoader.h:
971         * loader/cache/CachedResource.cpp:
972         (WebCore::CachedResource::load):
973         * page/csp/ContentSecurityPolicy.cpp:
974         (WebCore::ContentSecurityPolicy::responseHeaders const):
975         (WebCore::ContentSecurityPolicy::didReceiveHeader):
976         * page/csp/ContentSecurityPolicy.h:
977         * page/csp/ContentSecurityPolicyResponseHeaders.h:
978         (WebCore::ContentSecurityPolicyResponseHeaders::encode const):
979         (WebCore::ContentSecurityPolicyResponseHeaders::decode):
980
981 2017-08-09  Yusuke Suzuki  <utatane.tea@gmail.com>
982
983         [WTF] ThreadSpecific should not introduce additional indirection
984         https://bugs.webkit.org/show_bug.cgi?id=175187
985
986         Reviewed by Mark Lam.
987
988         We drop ThreadSpecific::replace feature which is only used by
989         Web thread. Instead, we use ThreadSpecific<std::unique_ptr<T>> here.
990
991         While this std::unique_ptr<T> shares one instance between main thread
992         and web thread, this is the same to the current implementation. It is
993         safe because the web thread never finishes.
994
995         And for non-web thread implementation, we just use ThreadSpecific<T>,
996         since it is the most efficient.
997
998         * platform/ThreadGlobalData.cpp:
999         (WebCore::ThreadGlobalData::ThreadGlobalData):
1000         (WebCore::ThreadGlobalData::setWebCoreThreadData):
1001         (WebCore::threadGlobalData):
1002         We also drop StringImpl::empty() call since it is not necessary now:
1003         StringImpl::empty data is statically initialized by using constexpr.
1004
1005         * platform/ThreadGlobalData.h:
1006         We make it FAST_ALLOCATED since it is previously allocated by fast malloc
1007         in ThreadSpecific.
1008
1009 2017-08-10  Michael Catanzaro  <mcatanzaro@igalia.com>
1010
1011         REGRESSION(r220515) [GTK][CMake] Build with ENABLE_GEOLOCATION fails on Debian Jessie
1012         https://bugs.webkit.org/show_bug.cgi?id=175426
1013
1014         Reviewed by Carlos Alberto Lopez Perez.
1015
1016         Also stop using GEOCLUE_LIBRARIES and GEOCLUE_INCLUDE_DIRS, since they are empty. Apparently
1017         we have not actually been using the client library at all this whole time, only the D-Bus
1018         interface.
1019
1020         * PlatformGTK.cmake:
1021
1022 2017-08-10  Brady Eidson  <beidson@apple.com>
1023
1024         Add ServiceWorkerJob.
1025         https://bugs.webkit.org/show_bug.cgi?id=175241
1026
1027         Reviewed by Tim Horton.
1028
1029         Test: http/tests/workers/service/basic-register.html
1030
1031         This patch does a few things:
1032         - Adds the spec concept of a ServiceWorkerJob (in the WebProcess, at least)
1033         - Adds a ServiceWorkerProvider interface for WebKit to implement
1034         - Actually creates a job for service worker registration and "schedules" it,
1035           though it always immediately errors out the promise.
1036
1037         Actually queuing jobs and executing asynchronously is coming up soon.
1038
1039         * CMakeLists.txt:
1040         * WebCore.xcodeproj/project.pbxproj:
1041
1042         * dom/Document.cpp:
1043         (WebCore::Document::sessionID const):
1044         * dom/Document.h:
1045
1046         * workers/ServiceWorkerContainer.cpp:
1047         (WebCore::ServiceWorkerContainer::~ServiceWorkerContainer):
1048         (WebCore::ServiceWorkerContainer::addRegistration):
1049         (WebCore::ServiceWorkerContainer::scheduleJob):
1050         (WebCore::ServiceWorkerContainer::jobDidFinish):
1051         * workers/ServiceWorkerContainer.h:
1052
1053         * workers/ServiceWorkerJob.cpp: Added.
1054         (WebCore::ServiceWorkerJob::ServiceWorkerJob):
1055         (WebCore::ServiceWorkerJob::~ServiceWorkerJob):
1056         (WebCore::ServiceWorkerJob::failedWithException):
1057         * workers/ServiceWorkerJob.h: Copied from Source/WebCore/workers/ServiceWorkerContainer.h.
1058         (WebCore::ServiceWorkerJob::createRegisterJob):
1059         (WebCore::ServiceWorkerJob::identifier const):
1060
1061         * workers/ServiceWorkerJobClient.h: Added.
1062         (WebCore::ServiceWorkerJobClient::~ServiceWorkerJobClient):
1063
1064         * workers/ServiceWorkerProvider.cpp: Added.
1065         (WebCore::ServiceWorkerProvider::singleton):
1066         (WebCore::ServiceWorkerProvider::setSharedProvider):
1067         * workers/ServiceWorkerProvider.h: Added.
1068         * workers/ServiceWorkerRegistrationOptions.h: Copied from Source/WebCore/workers/ServiceWorkerContainer.h.
1069         * workers/ServiceWorkerRegistrationParameters.cpp: Added.
1070         * workers/ServiceWorkerRegistrationParameters.h: Added.
1071
1072 2017-08-10  Tim Horton  <timothy_horton@apple.com>
1073
1074         Remove some unused lambda captures so that WebKit builds with -Wunused-lambda-capture
1075         https://bugs.webkit.org/show_bug.cgi?id=175436
1076         <rdar://problem/33667497>
1077
1078         Reviewed by Simon Fraser.
1079
1080         * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
1081         (PlatformMediaSessionManager::updateSessionState):
1082         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
1083         (WebCore::WebCoreDecompressionSession::handleDecompressionOutput):
1084
1085 2017-08-10  Commit Queue  <commit-queue@webkit.org>
1086
1087         Unreviewed, rolling out r220463.
1088         https://bugs.webkit.org/show_bug.cgi?id=175435
1089
1090         unaccepted fix (Requested by n_wang on #webkit).
1091
1092         Reverted changeset:
1093
1094         "AX: crash at
1095         WebCore::AccessibilityObject::supportsARIALiveRegion() const +
1096         24"
1097         https://bugs.webkit.org/show_bug.cgi?id=175340
1098         http://trac.webkit.org/changeset/220463
1099
1100 2017-08-10  Michael Catanzaro  <mcatanzaro@igalia.com>
1101
1102         Remove ENABLE_GAMEPAD_DEPRECATED
1103         https://bugs.webkit.org/show_bug.cgi?id=175361
1104
1105         Reviewed by Carlos Garcia Campos.
1106
1107         * CMakeLists.txt:
1108         * Configurations/FeatureDefines.xcconfig:
1109         * PlatformGTK.cmake:
1110         * PlatformWPE.cmake:
1111         * platform/Linux.cmake: Removed.
1112         * platform/gamepad/deprecated/Gamepads.h: Removed.
1113         * platform/gamepad/glib/GamepadsGlib.cpp: Removed.
1114         * platform/gamepad/linux/GamepadDeviceLinux.cpp: Removed.
1115         * platform/gamepad/linux/GamepadDeviceLinux.h: Removed.
1116
1117 2017-08-10  Myles C. Maxfield  <mmaxfield@apple.com>
1118
1119         Addressing post-review comments after r219173.
1120         https://bugs.webkit.org/show_bug.cgi?id=174149
1121
1122         Unreviewed.
1123
1124         * css/CSSFontStyleValue.h:
1125         * editing/EditingStyle.cpp:
1126         (WebCore::identifierForStyleProperty):
1127
1128 2017-08-10  Antti Koivisto  <antti@apple.com>
1129
1130         Try to fix windows build.
1131
1132         * style/StyleUpdate.h:
1133         (WebCore::Style::TextUpdate::TextUpdate):
1134
1135 2017-08-10  Carlos Garcia Campos  <cgarcia@igalia.com>
1136
1137         [GTK] Crashes in WebCore::PasteboardHelper::fillSelectionData when source file of drag is unavailable
1138         https://bugs.webkit.org/show_bug.cgi?id=174161
1139
1140         Reviewed by Xabier Rodriguez-Calvar.
1141
1142         In r219385 we changed the early return in fillSelectionData() to check the selection data length instead of the
1143         data pointer. However, the gtk_selection_data_get_length() can return -1, so we need to check also if the value
1144         less than 0. The case of setting an empty string could be valid depending on the target type, so it's better to
1145         return early only when data lenght is less than 0 and handle the 0 length case in each target.
1146
1147         * platform/gtk/PasteboardHelper.cpp:
1148         (WebCore::PasteboardHelper::fillSelectionData):
1149
1150 2017-08-10  Antti Koivisto  <antti@apple.com>
1151
1152         Text renderer updates should be done by RenderTreeUpdater
1153         https://bugs.webkit.org/show_bug.cgi?id=175417
1154
1155         Reviewed by Andreas Kling.
1156
1157         All render tree mutations should be done by RenderTreeUpdater. Currently
1158         Text::updateRendererAfterContentChange calls RenderText::setTextWithOffset directly.
1159
1160         * dom/Document.cpp:
1161         (WebCore::Document::updateTextRenderer):
1162
1163             Add range argument.
1164
1165         * dom/Document.h:
1166         * dom/Text.cpp:
1167         (WebCore::Text::updateRendererAfterContentChange):
1168
1169             Remove call to setTextWithOffset and pass the range to updateTextRenderer
1170
1171         * style/RenderTreeUpdater.cpp:
1172         (WebCore::RenderTreeUpdater::updateRenderTree):
1173         (WebCore::RenderTreeUpdater::updateTextRenderer):
1174
1175             Call setTextWithOffset here.
1176
1177         * style/RenderTreeUpdater.h:
1178         * style/StyleTreeResolver.cpp:
1179         (WebCore::Style::TreeResolver::resolveComposedTree):
1180         * style/StyleUpdate.cpp:
1181         (WebCore::Style::Update::textUpdate const):
1182         (WebCore::Style::Update::addText):
1183
1184             Add TextUpdate struct similar to ElementUpdate to pass the range to the RenderTreeUpdater.
1185
1186         * style/StyleUpdate.h:
1187
1188 2017-08-10  Zan Dobersek  <zdobersek@igalia.com>
1189
1190         Unreviewed GTK+ build fix for ENABLE_GLES2=ON.
1191
1192         * platform/graphics/texmap/TextureMapperGLHeaders.h:
1193         Define various GL constants that are not provided in GLES2 headers
1194         but are only leveraged in OpenGL calls if at runtime the underlying
1195         OpenGL is GLES2-capable.
1196
1197 2017-08-10  Zan Dobersek  <zdobersek@igalia.com>
1198
1199         [TexMap] Remove GraphicsContext3D usage from BitmapTexturePool
1200         https://bugs.webkit.org/show_bug.cgi?id=175319
1201
1202         Reviewed by Carlos Garcia Campos.
1203
1204         Drop the GraphicsContext3D reference in BitmapTexturePool now
1205         that the BitmapTextureGL doesn't require it anymore.
1206
1207         No new tests -- no change in behavior.
1208
1209         * platform/graphics/texmap/BitmapTexturePool.cpp:
1210         (WebCore::BitmapTexturePool::BitmapTexturePool):
1211         * platform/graphics/texmap/BitmapTexturePool.h:
1212         * platform/graphics/texmap/TextureMapperGL.cpp:
1213         (WebCore::TextureMapperGL::TextureMapperGL):
1214
1215 2017-08-10  Zan Dobersek  <zdobersek@igalia.com>
1216
1217         [TexMap] Drop GraphicsContext3D usage from BitmapTextureGL
1218         https://bugs.webkit.org/show_bug.cgi?id=175317
1219
1220         Reviewed by Carlos Garcia Campos.
1221
1222         Have BitmapTextureGL use direct OpenGL API entrypoints and constants
1223         instead of leveraging the GraphicsContext3D class. Any GraphicsContext3D
1224         object passed to BitmapTextureGL would assume rendering to the GL context
1225         that's current on that thread, translating method invocations to the
1226         OpenGL API. We can do this by ourselves and benefit by avoiding allocating
1227         GraphicsContext3D resources like the ANGLE compiler that are by most useful
1228         for WebGL.
1229
1230         BitmapTextureGL::create() call sites are adjusted to stop passing a
1231         GraphicsContext3D reference. BitmapTextureGL::bindAsSurface() doesn't need
1232         a replacement for the passed-in GraphicsContext3D object since that object
1233         originated from the TextureMapperGL instance, whose GraphicsContext3D is by
1234         default of the render-to-current-context nature. Other changes are direct
1235         translations of GraphicsContext3D methods to OpenGL API calls, or of
1236         GraphicsContext3D values to OpenGL API constants.
1237
1238         No new tests -- no change in behavior.
1239
1240         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1241         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
1242         * platform/graphics/texmap/BitmapTextureGL.cpp:
1243         Also remove an unnecessary GraphicsContext.h header inclusion.
1244         (WebCore::BitmapTextureGL::BitmapTextureGL):
1245         (WebCore::BitmapTextureGL::didReset):
1246         (WebCore::BitmapTextureGL::updateContentsNoSwizzle):
1247         (WebCore::BitmapTextureGL::updateContents):
1248         (WebCore::BitmapTextureGL::initializeStencil):
1249         (WebCore::BitmapTextureGL::initializeDepthBuffer):
1250         (WebCore::BitmapTextureGL::clearIfNeeded):
1251         (WebCore::BitmapTextureGL::createFboIfNeeded):
1252         (WebCore::BitmapTextureGL::bindAsSurface):
1253         (WebCore::BitmapTextureGL::~BitmapTextureGL):
1254         (WebCore::BitmapTextureGL::copyFromExternalTexture):
1255         * platform/graphics/texmap/BitmapTextureGL.h:
1256         (WebCore::BitmapTextureGL::create):
1257         (WebCore::BitmapTextureGL::textureTarget const):
1258         (WebCore::BitmapTextureGL::internalFormat const):
1259         * platform/graphics/texmap/BitmapTexturePool.cpp:
1260         (WebCore::BitmapTexturePool::createTexture):
1261         * platform/graphics/texmap/TextureMapperGL.cpp:
1262         (WebCore::TextureMapperGL::bindSurface):
1263         (WebCore::TextureMapperGL::createTexture):
1264
1265 2017-08-09  Michael Catanzaro  <mcatanzaro@igalia.com>
1266
1267         [GTK] Remove support for geoclue1
1268         https://bugs.webkit.org/show_bug.cgi?id=164205
1269
1270         Reviewed by Carlos Garcia Campos.
1271
1272         * PlatformGTK.cmake:
1273         * platform/geoclue/GeolocationProviderGeoclue.h:
1274         * platform/geoclue/GeolocationProviderGeoclue1.cpp: Removed.
1275         * platform/geoclue/GeolocationProviderGeoclue2.cpp: Removed.
1276
1277 2017-08-09  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
1278
1279         [PAL] Move spi/cocoa and spi/cg directories into PAL
1280         https://bugs.webkit.org/show_bug.cgi?id=175175
1281
1282         Reviewed by Myles C. Maxfield.
1283
1284         * Modules/applepay/cocoa/PaymentCocoa.mm:
1285         * Modules/applepay/cocoa/PaymentContactCocoa.mm:
1286         * Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm:
1287         * Modules/applepay/cocoa/PaymentMethodCocoa.mm:
1288         * PlatformAppleWin.cmake:
1289         * WebCore.xcodeproj/project.pbxproj:
1290         * editing/cocoa/EditorCocoa.mm:
1291         * editing/cocoa/HTMLConverter.mm:
1292         * editing/ios/EditorIOS.mm:
1293         * page/cocoa/ResourceUsageThreadCocoa.mm:
1294         * page/mac/TextIndicatorWindow.mm:
1295         * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
1296         * platform/cocoa/DataDetectorsCoreSoftLink.h:
1297         * platform/cocoa/MIMETypeRegistryCocoa.mm:
1298         * platform/cocoa/NetworkExtensionContentFilter.mm:
1299         * platform/cocoa/ParentalControlsContentFilter.mm:
1300         * platform/cocoa/SleepDisablerCocoa.cpp:
1301         * platform/graphics/Font.cpp:
1302         * platform/graphics/Font.h:
1303         * platform/graphics/avfoundation/objc/AVAssetTrackUtilities.mm:
1304         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
1305         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1306         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm:
1307         * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm:
1308         * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
1309         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1310         * platform/graphics/cg/ColorCG.cpp:
1311         * platform/graphics/cg/GraphicsContextCG.cpp:
1312         * platform/graphics/cg/ImageBufferCG.cpp:
1313         * platform/graphics/cg/ImageBufferDataCG.cpp:
1314         * platform/graphics/cg/ImageDecoderCG.cpp:
1315         * platform/graphics/cg/NativeImageCG.cpp:
1316         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1317         * platform/graphics/cocoa/FontCascadeCocoa.mm:
1318         * platform/graphics/cocoa/FontCocoa.mm:
1319         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
1320         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
1321         * platform/graphics/cocoa/IOSurface.mm:
1322         * platform/graphics/cocoa/TextTrackRepresentationCocoa.mm:
1323         * platform/graphics/cocoa/WebActionDisablingCALayerDelegate.h:
1324         * platform/graphics/ios/FontAntialiasingStateSaver.h:
1325         * platform/graphics/ios/FontCacheIOS.mm:
1326         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
1327         * platform/graphics/mac/FontCacheMac.mm:
1328         * platform/graphics/mac/GlyphPageMac.cpp:
1329         * platform/graphics/win/FontCacheWin.cpp:
1330         * platform/ios/LegacyTileCache.mm:
1331         * platform/ios/LegacyTileGrid.mm:
1332         * platform/ios/LegacyTileGridTile.mm:
1333         * platform/ios/PlaybackSessionInterfaceAVKit.mm:
1334         * platform/ios/QuickLook.mm:
1335         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1336         * platform/ios/WebAVPlayerController.h:
1337         * platform/ios/WebAVPlayerController.mm:
1338         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1339         * platform/ios/wak/WKGraphics.mm:
1340         * platform/mac/DragImageMac.mm:
1341         * platform/mac/PlatformScreenMac.mm:
1342         * platform/mac/PlaybackSessionInterfaceMac.mm:
1343         * platform/mac/ThemeMac.mm:
1344         * platform/mac/VideoFullscreenInterfaceMac.mm:
1345         * platform/mac/WebPlaybackControlsManager.h:
1346         * platform/mac/WebVideoFullscreenHUDWindowController.mm:
1347         * platform/network/cocoa/CookieStorageObserver.mm:
1348         * platform/network/cocoa/NetworkLoadMetrics.mm:
1349         * platform/network/mac/AuthenticationMac.mm:
1350         * platform/network/mac/ResourceHandleMac.mm:
1351         * platform/spi/ios/DataDetectorsUISPI.h:
1352         * platform/spi/mac/DataDetectorsSPI.h:
1353         * platform/spi/mac/NSViewSPI.h:
1354         * rendering/RenderThemeCocoa.mm:
1355         * rendering/RenderThemeIOS.mm:
1356         * rendering/RenderThemeMac.mm:
1357
1358 2017-08-09  Don Olmstead  <don.olmstead@sony.com>
1359
1360         [WTF] Move TextStream into WTF
1361         https://bugs.webkit.org/show_bug.cgi?id=175211
1362
1363         Reviewed by Myles C. Maxfield.
1364
1365         No new tests. No change in behavior.
1366
1367         * CMakeLists.txt:
1368         * WebCore.xcodeproj/project.pbxproj:
1369         * dom/ComposedTreeIterator.cpp:
1370         * dom/Position.cpp:
1371         * dom/Position.h:
1372         * dom/Range.cpp:
1373         (WebCore::operator<<):
1374         * dom/Range.h:
1375         * dom/ViewportArguments.cpp:
1376         * dom/ViewportArguments.h:
1377         * editing/VisiblePosition.cpp:
1378         * editing/VisiblePosition.h:
1379         * editing/VisibleSelection.cpp:
1380         * editing/VisibleSelection.h:
1381         * html/HTMLVideoElement.cpp:
1382         * html/canvas/CanvasRenderingContext2D.cpp:
1383         * page/FrameView.cpp:
1384         * page/ViewportConfiguration.cpp:
1385         * page/ViewportConfiguration.h:
1386         * page/WheelEventDeltaFilter.cpp:
1387         * page/animation/CSSPropertyAnimation.cpp:
1388         * page/scrolling/AsyncScrollingCoordinator.cpp:
1389         * page/scrolling/ScrollingConstraints.cpp:
1390         * page/scrolling/ScrollingConstraints.h:
1391         * page/scrolling/ScrollingCoordinator.cpp:
1392         * page/scrolling/ScrollingCoordinator.h:
1393         * page/scrolling/ScrollingStateFixedNode.cpp:
1394         * page/scrolling/ScrollingStateFixedNode.h:
1395         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
1396         * page/scrolling/ScrollingStateFrameScrollingNode.h:
1397         * page/scrolling/ScrollingStateNode.cpp:
1398         * page/scrolling/ScrollingStateNode.h:
1399         * page/scrolling/ScrollingStateOverflowScrollingNode.cpp:
1400         * page/scrolling/ScrollingStateOverflowScrollingNode.h:
1401         * page/scrolling/ScrollingStateScrollingNode.cpp:
1402         * page/scrolling/ScrollingStateScrollingNode.h:
1403         * page/scrolling/ScrollingStateStickyNode.cpp:
1404         * page/scrolling/ScrollingStateStickyNode.h:
1405         * page/scrolling/ScrollingTree.cpp:
1406         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
1407         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
1408         * page/scrolling/ScrollingTreeNode.cpp:
1409         * page/scrolling/ScrollingTreeNode.h:
1410         * page/scrolling/ScrollingTreeScrollingNode.cpp:
1411         * page/scrolling/ScrollingTreeScrollingNode.h:
1412         * page/scrolling/mac/ScrollingTreeFixedNode.h:
1413         * page/scrolling/mac/ScrollingTreeFixedNode.mm:
1414         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1415         * page/scrolling/mac/ScrollingTreeStickyNode.h:
1416         * page/scrolling/mac/ScrollingTreeStickyNode.mm:
1417         * platform/CalculationValue.cpp:
1418         * platform/CalculationValue.h:
1419         * platform/LayoutUnit.cpp:
1420         * platform/LayoutUnit.h:
1421         * platform/Length.cpp:
1422         * platform/Length.h:
1423         * platform/LengthBox.cpp:
1424         * platform/LengthBox.h:
1425         * platform/LengthPoint.cpp:
1426         * platform/LengthPoint.h:
1427         * platform/LengthSize.cpp:
1428         * platform/LengthSize.h:
1429         * platform/LogMacros.h:
1430         * platform/ScrollView.cpp:
1431         * platform/ScrollableArea.cpp:
1432         * platform/animation/TimingFunction.cpp:
1433         * platform/animation/TimingFunction.h:
1434         * platform/graphics/BitmapImage.cpp:
1435         * platform/graphics/BitmapImage.h:
1436         * platform/graphics/Color.cpp:
1437         * platform/graphics/Color.h:
1438         * platform/graphics/CrossfadeGeneratedImage.cpp:
1439         * platform/graphics/CrossfadeGeneratedImage.h:
1440         * platform/graphics/FloatPoint.cpp:
1441         * platform/graphics/FloatPoint.h:
1442         * platform/graphics/FloatPoint3D.cpp:
1443         * platform/graphics/FloatPoint3D.h:
1444         * platform/graphics/FloatRect.cpp:
1445         * platform/graphics/FloatRect.h:
1446         * platform/graphics/FloatRoundedRect.cpp:
1447         * platform/graphics/FloatRoundedRect.h:
1448         * platform/graphics/FloatSize.cpp:
1449         * platform/graphics/FloatSize.h:
1450         * platform/graphics/FontTaggedSettings.cpp:
1451         * platform/graphics/FontTaggedSettings.h:
1452         * platform/graphics/GradientImage.cpp:
1453         (WebCore::GradientImage::dump const):
1454         * platform/graphics/GradientImage.h:
1455         * platform/graphics/GraphicsContext.cpp:
1456         * platform/graphics/GraphicsContext.h:
1457         * platform/graphics/GraphicsLayer.cpp:
1458         * platform/graphics/GraphicsLayer.h:
1459         (WebCore::GraphicsLayer::dumpAdditionalProperties const):
1460         * platform/graphics/GraphicsTypes.cpp:
1461         * platform/graphics/GraphicsTypes.h:
1462         * platform/graphics/Image.cpp:
1463         * platform/graphics/Image.h:
1464         * platform/graphics/ImageSource.h:
1465         * platform/graphics/IntPoint.cpp:
1466         * platform/graphics/IntPoint.h:
1467         * platform/graphics/IntRect.cpp:
1468         * platform/graphics/IntRect.h:
1469         * platform/graphics/IntSize.cpp:
1470         * platform/graphics/IntSize.h:
1471         * platform/graphics/LayoutPoint.cpp:
1472         * platform/graphics/LayoutPoint.h:
1473         * platform/graphics/LayoutRect.cpp:
1474         * platform/graphics/LayoutRect.h:
1475         * platform/graphics/LayoutSize.cpp:
1476         * platform/graphics/LayoutSize.h:
1477         * platform/graphics/NamedImageGeneratedImage.cpp:
1478         * platform/graphics/NamedImageGeneratedImage.h:
1479         * platform/graphics/Path.cpp:
1480         * platform/graphics/Path.h:
1481         * platform/graphics/ca/GraphicsLayerCA.cpp:
1482         * platform/graphics/ca/GraphicsLayerCA.h:
1483         * platform/graphics/ca/PlatformCAAnimation.cpp:
1484         * platform/graphics/ca/PlatformCAAnimation.h:
1485         * platform/graphics/ca/PlatformCALayer.cpp:
1486         * platform/graphics/ca/PlatformCALayer.h:
1487         * platform/graphics/ca/TileController.cpp:
1488         * platform/graphics/ca/TileGrid.cpp:
1489         * platform/graphics/cg/GraphicsContextCG.cpp:
1490         * platform/graphics/cg/PDFDocumentImage.cpp:
1491         * platform/graphics/cg/PDFDocumentImage.h:
1492         * platform/graphics/cocoa/IOSurface.h:
1493         * platform/graphics/cocoa/IOSurface.mm:
1494         * platform/graphics/displaylists/DisplayList.cpp:
1495         (WebCore::DisplayList::DisplayList::description const):
1496         * platform/graphics/displaylists/DisplayList.h:
1497         * platform/graphics/displaylists/DisplayListItems.cpp:
1498         * platform/graphics/displaylists/DisplayListItems.h:
1499         * platform/graphics/displaylists/DisplayListRecorder.cpp:
1500         * platform/graphics/displaylists/DisplayListReplayer.cpp:
1501         * platform/graphics/filters/DistantLightSource.cpp:
1502         * platform/graphics/filters/DistantLightSource.h:
1503         * platform/graphics/filters/FEBlend.cpp:
1504         * platform/graphics/filters/FEBlend.h:
1505         * platform/graphics/filters/FEColorMatrix.cpp:
1506         * platform/graphics/filters/FEColorMatrix.h:
1507         * platform/graphics/filters/FEComponentTransfer.cpp:
1508         * platform/graphics/filters/FEComponentTransfer.h:
1509         * platform/graphics/filters/FEComposite.cpp:
1510         * platform/graphics/filters/FEComposite.h:
1511         * platform/graphics/filters/FEConvolveMatrix.cpp:
1512         * platform/graphics/filters/FEConvolveMatrix.h:
1513         * platform/graphics/filters/FEDiffuseLighting.cpp:
1514         * platform/graphics/filters/FEDiffuseLighting.h:
1515         * platform/graphics/filters/FEDisplacementMap.cpp:
1516         * platform/graphics/filters/FEDisplacementMap.h:
1517         * platform/graphics/filters/FEDropShadow.cpp:
1518         * platform/graphics/filters/FEDropShadow.h:
1519         * platform/graphics/filters/FEFlood.cpp:
1520         * platform/graphics/filters/FEFlood.h:
1521         * platform/graphics/filters/FEGaussianBlur.cpp:
1522         * platform/graphics/filters/FEGaussianBlur.h:
1523         * platform/graphics/filters/FEMerge.cpp:
1524         * platform/graphics/filters/FEMerge.h:
1525         * platform/graphics/filters/FEMorphology.cpp:
1526         * platform/graphics/filters/FEMorphology.h:
1527         * platform/graphics/filters/FEOffset.cpp:
1528         * platform/graphics/filters/FEOffset.h:
1529         * platform/graphics/filters/FESpecularLighting.cpp:
1530         * platform/graphics/filters/FESpecularLighting.h:
1531         * platform/graphics/filters/FETile.cpp:
1532         * platform/graphics/filters/FETile.h:
1533         * platform/graphics/filters/FETurbulence.cpp:
1534         * platform/graphics/filters/FETurbulence.h:
1535         * platform/graphics/filters/FilterEffect.cpp:
1536         * platform/graphics/filters/FilterEffect.h:
1537         * platform/graphics/filters/FilterOperation.cpp:
1538         * platform/graphics/filters/FilterOperation.h:
1539         * platform/graphics/filters/FilterOperations.cpp:
1540         * platform/graphics/filters/FilterOperations.h:
1541         * platform/graphics/filters/LightSource.h:
1542         * platform/graphics/filters/PointLightSource.cpp:
1543         * platform/graphics/filters/PointLightSource.h:
1544         * platform/graphics/filters/SourceAlpha.cpp:
1545         * platform/graphics/filters/SourceAlpha.h:
1546         * platform/graphics/filters/SourceGraphic.cpp:
1547         * platform/graphics/filters/SourceGraphic.h:
1548         * platform/graphics/filters/SpotLightSource.cpp:
1549         * platform/graphics/filters/SpotLightSource.h:
1550         * platform/graphics/transforms/AffineTransform.cpp:
1551         * platform/graphics/transforms/AffineTransform.h:
1552         * platform/graphics/transforms/IdentityTransformOperation.h:
1553         * platform/graphics/transforms/Matrix3DTransformOperation.cpp:
1554         * platform/graphics/transforms/Matrix3DTransformOperation.h:
1555         * platform/graphics/transforms/MatrixTransformOperation.cpp:
1556         * platform/graphics/transforms/MatrixTransformOperation.h:
1557         * platform/graphics/transforms/PerspectiveTransformOperation.cpp:
1558         * platform/graphics/transforms/PerspectiveTransformOperation.h:
1559         * platform/graphics/transforms/RotateTransformOperation.cpp:
1560         * platform/graphics/transforms/RotateTransformOperation.h:
1561         * platform/graphics/transforms/ScaleTransformOperation.cpp:
1562         * platform/graphics/transforms/ScaleTransformOperation.h:
1563         * platform/graphics/transforms/SkewTransformOperation.cpp:
1564         * platform/graphics/transforms/SkewTransformOperation.h:
1565         * platform/graphics/transforms/TransformOperation.cpp:
1566         * platform/graphics/transforms/TransformOperation.h:
1567         * platform/graphics/transforms/TransformOperations.cpp:
1568         * platform/graphics/transforms/TransformOperations.h:
1569         * platform/graphics/transforms/TransformationMatrix.cpp:
1570         * platform/graphics/transforms/TransformationMatrix.h:
1571         * platform/graphics/transforms/TranslateTransformOperation.cpp:
1572         * platform/graphics/transforms/TranslateTransformOperation.h:
1573         * platform/ios/SelectionRect.cpp:
1574         (WebCore::operator<<):
1575         * platform/ios/SelectionRect.h:
1576         * platform/mac/ScrollAnimatorMac.mm:
1577         * platform/text/TextAllInOne.cpp:
1578         * rendering/InlineBox.cpp:
1579         * rendering/InlineBox.h:
1580         * rendering/InlineFlowBox.cpp:
1581         (WebCore::InlineFlowBox::outputLineTreeAndMark const):
1582         * rendering/InlineFlowBox.h:
1583         * rendering/InlineTextBox.cpp:
1584         * rendering/InlineTextBox.h:
1585         * rendering/RenderBlockFlow.cpp:
1586         (WebCore::RenderBlockFlow::outputLineTreeAndMark const):
1587         * rendering/RenderBlockFlow.h:
1588         * rendering/RenderLayer.cpp:
1589         * rendering/RenderLayerCompositor.cpp:
1590         * rendering/RenderObject.cpp:
1591         * rendering/RenderObject.h:
1592         * rendering/RenderTreeAsText.cpp:
1593         * rendering/RenderTreeAsText.h:
1594         * rendering/ScrollAlignment.cpp:
1595         * rendering/ScrollAlignment.h:
1596         * rendering/SimpleLineLayoutCoverage.cpp:
1597         * rendering/SimpleLineLayoutFunctions.cpp:
1598         * rendering/SimpleLineLayoutFunctions.h:
1599         * rendering/style/FillLayer.cpp:
1600         * rendering/style/FillLayer.h:
1601         * rendering/style/NinePieceImage.cpp:
1602         * rendering/style/NinePieceImage.h:
1603         * rendering/style/RenderStyleConstants.cpp:
1604         * rendering/style/RenderStyleConstants.h:
1605         * rendering/svg/SVGRenderTreeAsText.cpp:
1606         (WebCore::operator<<):
1607         * rendering/svg/SVGRenderTreeAsText.h:
1608         (WebCore::operator<<):
1609         * svg/SVGLengthValue.cpp:
1610         * svg/SVGLengthValue.h:
1611         * svg/graphics/SVGImage.cpp:
1612         * svg/graphics/SVGImage.h:
1613         * svg/graphics/filters/SVGFEImage.cpp:
1614         * svg/graphics/filters/SVGFEImage.h:
1615
1616 2017-08-09  Commit Queue  <commit-queue@webkit.org>
1617
1618         Unreviewed, rolling out r220466, r220477, and r220487.
1619         https://bugs.webkit.org/show_bug.cgi?id=175411
1620
1621         This change broke existing API tests and follow up fixes did
1622         not resolve all the issues. (Requested by ryanhaddad on
1623         #webkit).
1624
1625         Reverted changesets:
1626
1627         https://bugs.webkit.org/show_bug.cgi?id=175244
1628         http://trac.webkit.org/changeset/220466
1629
1630         "WTF::Function does not allow for reference / non-default
1631         constructible return types"
1632         https://bugs.webkit.org/show_bug.cgi?id=175244
1633         http://trac.webkit.org/changeset/220477
1634
1635         https://bugs.webkit.org/show_bug.cgi?id=175244
1636         http://trac.webkit.org/changeset/220487
1637
1638 2017-08-09  Chris Dumez  <cdumez@apple.com>
1639
1640         [Beacon][NetworkSession] Support CORS-preflighting on redirects
1641         https://bugs.webkit.org/show_bug.cgi?id=175386
1642         <rdar://problem/33801370>
1643
1644         Reviewed by Youenn Fablet.
1645
1646         Export a couple of WebCore symbols so I can use them in WebKit2.
1647
1648         Tests: http/wpt/beacon/cors/cors-preflight-redirect-failure.html
1649                http/wpt/beacon/cors/cors-preflight-redirect-from-crossorigin-to-sameorigin.html
1650                http/wpt/beacon/cors/cors-preflight-redirect-success.html
1651
1652         * loader/CrossOriginAccessControl.h:
1653         * page/SecurityOrigin.h:
1654
1655 2017-08-09  Jeremy Jones  <jeremyj@apple.com>
1656
1657         Use MPAVRoutingController instead of deprecated versions.
1658         https://bugs.webkit.org/show_bug.cgi?id=175063
1659
1660         Reviewed by Tim Horton.
1661
1662         No new tests because no behavior change. This uses a different platform class to present
1663         an interface.
1664
1665         Remove deprecated MPAudioVideoRoutingPopoverController and MPAVRoutingSheet
1666         Add MPMediaControlsViewController.
1667
1668         * platform/spi/ios/MediaPlayerSPI.h:
1669
1670 2017-08-09  Myles C. Maxfield  <mmaxfield@apple.com>
1671
1672         Mark font-display as in development
1673         https://bugs.webkit.org/show_bug.cgi?id=175387
1674
1675         Unreviewed.
1676
1677         * features.json:
1678
1679 2017-08-09  Commit Queue  <commit-queue@webkit.org>
1680
1681         Unreviewed, rolling out r219334.
1682         https://bugs.webkit.org/show_bug.cgi?id=175398
1683
1684         Caused bug 175023 (Requested by ap on #webkit).
1685
1686         Reverted changeset:
1687
1688         "[SVG] Leak in SVGAnimatedListPropertyTearOff"
1689         https://bugs.webkit.org/show_bug.cgi?id=172545
1690         http://trac.webkit.org/changeset/219334
1691
1692 2017-08-09  Dave Hyatt  <hyatt@apple.com>
1693
1694         [Repaint from Layout Removal] Move layer repaint rects into a map
1695         https://bugs.webkit.org/show_bug.cgi?id=175393
1696
1697         Reviewed by Zalan Bujtas.
1698
1699         Move the two repaint rects held by RenderLayer into a RenderLayerModelObject -> RepaintLayoutRects hash map.
1700         RepaintLayoutRects is a new struct that holds both rects.
1701
1702         Eventually more objects than just self painting layers will be caching repaint rects, so this takes a first
1703         step towards having a common cache for these repaint rects. In addition this change saves memory, since
1704         layers that aren't self-painting no longer have empty repaint rects taking up space in RenderLayer.
1705
1706         * rendering/RenderBlockLineLayout.cpp:
1707         (WebCore::RenderBlockFlow::layoutRunsAndFloats):
1708         * rendering/RenderLayer.cpp:
1709         (WebCore::RenderLayer::RenderLayer):
1710         (WebCore::RenderLayer::updateLayerPositions):
1711         (WebCore::RenderLayer::repaintRectIncludingNonCompositingDescendants):
1712         (WebCore::RenderLayer::computeRepaintRects):
1713         (WebCore::RenderLayer::clearRepaintRects):
1714         (WebCore::RenderLayer::updateLayerPositionsAfterScroll):
1715         (WebCore::RenderLayer::scrollTo):
1716         * rendering/RenderLayer.h:
1717         * rendering/RenderLayerModelObject.cpp:
1718         (WebCore::RepaintLayoutRects::RepaintLayoutRects):
1719         (WebCore::RenderLayerModelObject::willBeDestroyed):
1720         (WebCore::RenderLayerModelObject::destroyLayer):
1721         (WebCore::RenderLayerModelObject::styleDidChange):
1722         (WebCore::RenderLayerModelObject::hasRepaintLayoutRects):
1723         (WebCore::RenderLayerModelObject::setRepaintLayoutRects):
1724         (WebCore::RenderLayerModelObject::clearRepaintLayoutRects):
1725         (WebCore::RenderLayerModelObject::repaintLayoutRects):
1726         (WebCore::RenderLayerModelObject::computeRepaintLayoutRects):
1727         * rendering/RenderLayerModelObject.h:
1728         (WebCore::RepaintLayoutRects::RepaintLayoutRects):
1729
1730 2017-08-09  Sam Weinig  <sam@webkit.org>
1731
1732         WTF::Function does not allow for reference / non-default constructible return types
1733         https://bugs.webkit.org/show_bug.cgi?id=175244
1734
1735         Reviewed by Chris Dumez.
1736
1737         * bindings/js/JSCustomElementInterface.h:
1738         (WebCore::JSCustomElementInterface::invokeCallback):
1739         Update the default value for the addArguments parameter to be an empty lambda, rather than
1740         default initialization, which leads to a null WTF::Function. This allows us to remove support
1741         for calling null WTF::Function. No change in behavior.
1742
1743 2017-08-09  Brady Eidson  <beidson@apple.com>
1744
1745         Teach ScriptExecutionContexts about their SessionID.
1746         https://bugs.webkit.org/show_bug.cgi?id=175391
1747
1748         Reviewed by Andy Estes.
1749
1750         No new tests (No current change in behavior).
1751
1752         Turns out that Workers need to know their SessionID for future feature development.
1753         So let's teach it to them.
1754
1755         * dom/ScriptExecutionContext.h: Expose a pure virtual SessionID accessor.
1756
1757         * dom/Document.cpp:
1758         (WebCore::Document::sessionID const):
1759         * dom/Document.h:
1760
1761         * page/SessionID.cpp:
1762         (WebCore::SessionID::isolatedCopy const):
1763         * page/SessionID.h:
1764
1765         * workers/DedicatedWorkerGlobalScope.cpp:
1766         (WebCore::DedicatedWorkerGlobalScope::create):
1767         (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
1768         * workers/DedicatedWorkerGlobalScope.h:
1769
1770         * workers/DedicatedWorkerThread.cpp:
1771         (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
1772         (WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
1773         * workers/DedicatedWorkerThread.h:
1774
1775         * workers/Worker.cpp:
1776         (WebCore::Worker::notifyFinished):
1777
1778         * workers/WorkerGlobalScope.cpp:
1779         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
1780         * workers/WorkerGlobalScope.h:
1781
1782         * workers/WorkerGlobalScopeProxy.h:
1783
1784         * workers/WorkerMessagingProxy.cpp:
1785         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
1786         * workers/WorkerMessagingProxy.h:
1787
1788         * workers/WorkerThread.cpp:
1789         (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
1790         (WebCore::WorkerThread::WorkerThread):
1791         (WebCore::WorkerThread::workerThread):
1792         * workers/WorkerThread.h:
1793
1794 2017-08-09  Wenson Hsieh  <wenson_hsieh@apple.com>
1795
1796         [iOS DnD] ENABLE_DRAG_SUPPORT should be turned off for iOS 10 and enabled by default
1797         https://bugs.webkit.org/show_bug.cgi?id=175392
1798         <rdar://problem/33783207>
1799
1800         Reviewed by Tim Horton and Megan Gardner.
1801
1802         Tweak FeatureDefines to enable drag and drop by default, and disable only on unsupported platforms (i.e. iOS 10).
1803         No change in behavior.
1804
1805         * Configurations/FeatureDefines.xcconfig:
1806
1807 2017-08-09  Kirill Ovchinnikov  <kirill.ovchinnikov@lge.com>
1808
1809         Old subtitle track is not deleted on 'src' attribute change event
1810         https://bugs.webkit.org/show_bug.cgi?id=175031
1811
1812         Reviewed by Eric Carlson.
1813
1814         Test: media/track/text-track-src-change.html
1815
1816         * html/HTMLMediaElement.cpp:
1817         (WebCore::HTMLMediaElement::textTrackReadyStateChanged):
1818         * html/HTMLTrackElement.cpp:
1819         (WebCore::HTMLTrackElement::loadTimerFired):
1820         * html/shadow/MediaControls.cpp:
1821         (WebCore::MediaControls::clearTextDisplayContainer):
1822         * html/shadow/MediaControls.h:
1823
1824 2017-08-09  Ryan Haddad  <ryanhaddad@apple.com>
1825
1826         Unreviewed, rolling out r220457.
1827
1828         This change introduced API test failures.
1829
1830         Reverted changeset:
1831
1832         "WTF::Function does not allow for reference / non-default
1833         constructible return types"
1834         https://bugs.webkit.org/show_bug.cgi?id=175244
1835         http://trac.webkit.org/changeset/220457
1836
1837 2017-08-09  Don Olmstead  <don.olmstead@sony.com>
1838
1839         [WinCairo] Fix build after rev 220399
1840         https://bugs.webkit.org/show_bug.cgi?id=175360
1841
1842         Reviewed by Žan Doberšek.
1843
1844         No new tests. No change in behavior.
1845
1846         * platform/graphics/texmap/TextureMapperGLHeaders.h:
1847
1848 2017-08-09  Nan Wang  <n_wang@apple.com>
1849
1850         AX: crash at WebCore::AccessibilityObject::supportsARIALiveRegion() const + 24
1851         https://bugs.webkit.org/show_bug.cgi?id=175340
1852         <rdar://problem/33782159>
1853
1854         Reviewed by Chris Fleizach.
1855
1856         When adding a psuedo element child to a RenderBlockFlow element, there might be a chance where
1857         the element has already been layed out but we are still holding onto its stale children. Fixed it
1858         by notifying AX correctly when inserting/removing children during layout.
1859
1860         Test: accessibility/add-children-pseudo-element.html
1861
1862         * rendering/RenderBlockFlow.cpp:
1863         (WebCore::RenderBlockFlow::insertFloatingObject):
1864         (WebCore::RenderBlockFlow::removeFloatingObject):
1865
1866 2017-08-09  Charlie Turner  <cturner@igalia.com>
1867
1868         [GStreamer][MSE] Add missing lock around getStreamByTrackId
1869         https://bugs.webkit.org/show_bug.cgi?id=175323
1870
1871         Reviewed by Xabier Rodriguez-Calvar.
1872
1873         Covered by existing tests.
1874
1875         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
1876         (WebCore::PlaybackPipeline::enqueueSample): Ensure the media source
1877         lock is taken before modifiying the track queues indirectly via the
1878         iterator use in getTrackId.
1879
1880 2017-08-09  Daniel Bates  <dabates@apple.com>
1881
1882         REGRESSION (r219013): OAuth flows are broken when redirecting back to application after authentication
1883         https://bugs.webkit.org/show_bug.cgi?id=175247
1884         <rdar://problem/33679804>
1885
1886         Reviewed by Brady Eidson.
1887
1888         Add SPI so that Safari can differentiate between a form submission and a redirected form submission
1889         and have PolicyCheck notify the frame loader client if the navigation was in response to receiving a
1890         redirect response. This is the WebKit portion to fix an issue when a native app makes use of an OAuth
1891         OAuth flow that bounces to Safari for user login and then bounce back to the app. Microsoft Graph's
1892         OAuth flow is one example.
1893
1894         Safari was differentiating between a form submission and a redirected form submission based on the
1895         nullity of WKNavigationAction.sourceFrame because in both cases the navigation type was WKNavigationTypeFormSubmitted.
1896         The navigation type is the same for both navigations because WebKit always used the navigation
1897         action from the original request for the redirect request when the original request redirected.
1898         Prior to r219013, WKNavigationAction.sourceFrame would be nil for a form submission that redirects.
1899         Following r219013, WKNavigationAction.sourceFrame is non-nil unless the navigation was initiated by
1900         API. In particular, WKNavigationAction.sourceFrame is non-nil for the redirect navigation corresponding
1901         to a form submission that redirects.
1902
1903         * loader/EmptyClients.cpp:
1904         (WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1905         * loader/FrameLoaderClient.h:
1906         Have dispatchDecidePolicyForNavigationAction() take a boolean as to whether the navigation was in
1907         response to receiving a redirect response.
1908         * loader/PolicyChecker.cpp:
1909         (WebCore::PolicyChecker::checkNavigationPolicy): Notify the frame loader client whether the navigation
1910         is in response to receiving a redirect response.
1911
1912 2017-08-09  Sam Weinig  <sam@webkit.org>
1913
1914         WTF::Function does not allow for reference / non-default constructible return types
1915         https://bugs.webkit.org/show_bug.cgi?id=175244
1916
1917         Reviewed by Chris Dumez.
1918
1919         * bindings/js/JSCustomElementInterface.h:
1920         (WebCore::JSCustomElementInterface::invokeCallback):
1921         Update the default value for the addArguments parameter to be an empty lambda, rather than
1922         default initialization, which leads to a null WTF::Function. This allows us to remove support
1923         for calling null WTF::Function. No change in behavior.
1924
1925 2017-08-09  Andy Estes  <aestes@apple.com>
1926
1927         [QuickLook] Use case-insensitive comparison of preview MIME types
1928         https://bugs.webkit.org/show_bug.cgi?id=175350
1929         <rdar://problem/33761159>
1930
1931         Reviewed by Brady Eidson.
1932
1933         MIME types are case-insensitive, but PreviewLoader was using a case-sensitive comparison to
1934         determine if a MIME type was supported by QLPreviewConverter. As a result we would fail to
1935         preview Excel macro-enabled workbooks, since CFNetwork would sniff a MIME type of
1936         "application/vnd.ms-excel.sheet.macroEnabled.12" but QuickLook contained
1937         "application/vnd.ms-excel.sheet.macroenabled.12" in its set of supported MIME type strings.
1938
1939         Fix this by copying the QuickLook supported MIME type set into a HashSet using
1940         ASCIICaseInsensitiveHash and using that HashSet for MIME type checks.
1941
1942         Test: quicklook/excel-macro-enabled.html
1943
1944         * loader/ios/PreviewLoader.mm:
1945         (WebCore::PreviewLoader::shouldCreateForMIMEType):
1946
1947 2017-08-09  Ms2ger  <Ms2ger@igalia.com>
1948
1949         Remove unnecessary copies of PlatformMediaSessionManager::m_sessions
1950         https://bugs.webkit.org/show_bug.cgi?id=175375
1951
1952         Reviewed by Sam Weinig.
1953
1954         Remove unnecessary copies of PlatformMediaSessionManager::m_sessions.
1955
1956         These should have been removed in r207688.
1957
1958         No new tests: no behavior change.
1959
1960         * platform/audio/PlatformMediaSessionManager.cpp:
1961         (WebCore::PlatformMediaSessionManager::applicationWillBecomeInactive const):
1962         (WebCore::PlatformMediaSessionManager::applicationDidBecomeActive const):
1963         (WebCore::PlatformMediaSessionManager::applicationDidEnterBackground const):
1964         (WebCore::PlatformMediaSessionManager::applicationWillEnterForeground const):
1965
1966 2017-08-09  Chris Dumez  <cdumez@apple.com>
1967
1968         Reinstate active flag for iterators
1969         https://bugs.webkit.org/show_bug.cgi?id=175312
1970
1971         Reviewed by Sam Weinig.
1972
1973         NodeIterator / TreeWalker should no longer allow recursive filters
1974         after the following change to the DOM specification:
1975         - https://github.com/whatwg/dom/pull/359
1976
1977         This patch aligns our behavior with the latest specification.
1978
1979         No new tests, updated existing tests.
1980
1981         * dom/NodeIterator.cpp:
1982         (WebCore::NodeIterator::nextNode):
1983         (WebCore::NodeIterator::previousNode):
1984         Note that we now also call m_candidateNode.clear() before returning an
1985         exception. This was a pre-existing bug that we failed to do so in the
1986         exception case but it became more obvious after this change now that
1987         we throw. This was causing traversal/moz-bug559526.html to fail
1988         otherwise (the filter was called one too many times). The test case
1989         is passing in Firefox (The filter is called 4 times and they throw
1990         each time).
1991
1992         * dom/Traversal.cpp:
1993         (WebCore::NodeIteratorBase::NodeIteratorBase):
1994         (WebCore::NodeIteratorBase::acceptNode):
1995         * dom/Traversal.h:
1996         * dom/TreeWalker.cpp:
1997
1998 2017-08-09  Antti Koivisto  <antti@apple.com>
1999
2000         RenderQuote should not mutate render tree
2001         https://bugs.webkit.org/show_bug.cgi?id=175328
2002
2003         Reviewed by Zalan Bujtas.
2004
2005         RenderQuote text renderers are currently created and deleted in a quirky fashion using a linked list.
2006         This patch moves to a simpler model that guarantees the mutations are always done in controlled fashion
2007         during render tree update.
2008
2009         * dom/Document.cpp:
2010         (WebCore::Document::updateTextRenderer):
2011
2012             Move text renderer updating to Document so we can set the inRenderTreeUpdate bit for it too.
2013
2014         * dom/Document.h:
2015         * dom/Text.cpp:
2016         (WebCore::Text::updateRendererAfterContentChange):
2017         * rendering/RenderDescendantIterator.h:
2018         (WebCore::RenderDescendantIteratorAdapter<T>::at):
2019         (WebCore::RenderDescendantConstIteratorAdapter<T>::at const):
2020
2021             Add at() function for starting iteration from a specified renderer.
2022
2023         * rendering/RenderQuote.cpp:
2024         (WebCore::RenderQuote::insertedIntoTree):
2025         (WebCore::RenderQuote::willBeRemovedFromTree):
2026
2027             Register and unregister quotes to RenderView.
2028             Don't do any mutations.
2029
2030         (WebCore::RenderQuote::styleDidChange):
2031
2032             Invalidate the text renderer but don't mutate it.
2033
2034         (WebCore::RenderQuote::updateTextRenderer):
2035         (WebCore::RenderQuote::computeText const):
2036         (WebCore::RenderQuote::updateRenderers):
2037
2038             Compute depth of all render quotes and update the text renderer as needed.
2039
2040         (WebCore::RenderQuote::willBeDestroyed): Deleted.
2041         (WebCore::RenderQuote::attachQuote): Deleted.
2042         (WebCore::RenderQuote::detachQuote): Deleted.
2043         (WebCore::RenderQuote::updateDepth): Deleted.
2044
2045             Get rid of the linked list.
2046
2047         * rendering/RenderQuote.h:
2048         * rendering/RenderView.cpp:
2049         (WebCore::RenderView::registerQuote):
2050         (WebCore::RenderView::unregisterQuote):
2051
2052             Maintain a render tree order ListHashSet of RenderQuotes.
2053
2054         (WebCore::RenderView::updateSpecialRenderers):
2055
2056             Add a function for making additional render tree mutations at the end of a render tree update.
2057             Currently this just invokes RenderQuote::updateRenderers.
2058
2059         * rendering/RenderView.h:
2060         * style/RenderTreeUpdater.cpp:
2061         (WebCore::RenderTreeUpdater::commit):
2062
2063             Call RenderView::updateSpecialRenderers after committing all other changes.
2064
2065 2017-08-09  Zan Dobersek  <zdobersek@igalia.com>
2066
2067         [Soup] Incorrect conversion in msToSoupDate()
2068         https://bugs.webkit.org/show_bug.cgi?id=175320
2069
2070         Reviewed by Carlos Garcia Campos.
2071
2072         Original patch by VaL Doroshchuk.
2073
2074         * platform/network/soup/NetworkStorageSessionSoup.cpp:
2075         (WebCore::msToSoupDate): monthFromDayInYear() returns a value in the [0,11] range,
2076         while soup_date_new() expects a month value in the [1,12] range. The return value
2077         must be thus incremented by one to match that expectation.
2078
2079 2017-08-08  Wenson Hsieh  <wenson_hsieh@apple.com>
2080
2081         Unreviewed, rolling out r220393.
2082
2083         This patch regresses the performance of WebPage::editorState.
2084
2085         Reverted changeset:
2086
2087         "[iOS WK2] WKWebView schedules nonstop layout after pressing
2088         cmb+b,i,u inside a contenteditable div"
2089         https://bugs.webkit.org/show_bug.cgi?id=175116
2090         http://trac.webkit.org/changeset/220393
2091
2092 2017-08-08  Chris Dumez  <cdumez@apple.com>
2093
2094         [Beacon] Add support for CORS-preflighting for WK2 / NETWORK_SESSION
2095         https://bugs.webkit.org/show_bug.cgi?id=175264
2096         <rdar://problem/33547793>
2097
2098         Reviewed by Youenn Fablet.
2099
2100         Pass additional information when creating a PingHandle so that the PingLoad
2101         can deal with CORS-preflighting on Network process side.
2102
2103         Tests: http/wpt/beacon/cors/cors-preflight-arraybufferview-failure.html
2104                http/wpt/beacon/cors/cors-preflight-arraybufferview-success.html
2105                http/wpt/beacon/cors/cors-preflight-blob-failure.html
2106                http/wpt/beacon/cors/cors-preflight-blob-success.html
2107                http/wpt/beacon/cors/cors-preflight-cookie.html
2108
2109         * WebCore.xcodeproj/project.pbxproj:
2110         * loader/CrossOriginAccessControl.cpp:
2111         (WebCore::validatePreflightResponse):
2112         * loader/CrossOriginAccessControl.h:
2113         * loader/CrossOriginPreflightChecker.cpp:
2114         (WebCore::CrossOriginPreflightChecker::validatePreflightResponse):
2115         * loader/CrossOriginPreflightResultCache.h:
2116         * loader/LoaderStrategy.h:
2117         * loader/PingLoader.cpp:
2118         (WebCore::PingLoader::loadImage):
2119         (WebCore::PingLoader::sendPing):
2120         (WebCore::PingLoader::sendViolationReport):
2121         (WebCore::PingLoader::startPingLoad):
2122         * loader/PingLoader.h:
2123         * loader/cache/CachedResource.cpp:
2124         (WebCore::CachedResource::load):
2125         * page/SecurityOrigin.h:
2126
2127 2017-08-08  Sam Weinig  <sam@webkit.org>
2128
2129         Address review feedback from https://bugs.webkit.org/show_bug.cgi?id=175246.
2130
2131         * bindings/js/DOMPromiseProxy.h:
2132         * css/FontFaceSet.cpp:
2133         * css/FontFaceSet.h:
2134
2135 2017-08-08  Devin Rousso  <drousso@apple.com>
2136
2137         Web Inspector: Canvas: support editing WebGL shaders
2138         https://bugs.webkit.org/show_bug.cgi?id=124211
2139         <rdar://problem/15448958>
2140
2141         Reviewed by Matt Baker.
2142
2143         Test: inspector/canvas/updateShader.html
2144
2145         * inspector/InspectorCanvasAgent.h:
2146         * inspector/InspectorCanvasAgent.cpp:
2147         (WebCore::InspectorCanvasAgent::updateShader):
2148
2149         * html/canvas/WebGLRenderingContextBase.h:
2150         * html/canvas/WebGLRenderingContextBase.cpp:
2151         (WebCore::WebGLRenderingContextBase::linkProgram):
2152         (WebCore::WebGLRenderingContextBase::linkProgramWithoutInvalidatingAttribLocations):
2153         Normally, when a program is linked, it invalidates any WebGLUniformLocation associated with
2154         the program by incrementing its `linkCount`. In order to allow live editing of shaders, we
2155         need to be able to compile and link a shader without invalidating these locations. This
2156         patch moves the shader linking logic to its own function that is called by `linkProgram` so
2157         that InspectorCanvasAgent can compile and link without invalidation.
2158
2159 2017-08-08  Sam Weinig  <sam@webkit.org>
2160
2161         [WebIDL] Add support for Promise<> attributes
2162         https://bugs.webkit.org/show_bug.cgi?id=175246
2163
2164         Reviewed by Yusuke Suzuki.
2165
2166         Introduces and adopts DOMPromiseProxy, a new class for binding promises in a more
2167         straightforward and safe (from a wrapper world perspective) way.
2168
2169         * CMakeLists.txt:
2170         * WebCore.xcodeproj/project.pbxproj:
2171         * bindings/js/JSFontFaceCustom.cpp: Removed.
2172         * bindings/js/JSFontFaceSetCustom.cpp: Removed.
2173         * bindings/js/JSMediaKeySessionCustom.cpp: Removed.
2174         * bindings/js/JSServiceWorkerContainerCustom.cpp: Removed.
2175         * bindings/js/JSWebGPUCommandBufferCustom.cpp: Removed.
2176
2177             Remove custom bindings only needed for promise attributes. Add DOMPromiseProxy.h
2178
2179         * Modules/encryptedmedia/MediaKeySession.cpp:
2180         (WebCore::MediaKeySession::sessionClosed):
2181         (WebCore::MediaKeySession::registerClosedPromise): Deleted.
2182         * Modules/encryptedmedia/MediaKeySession.h:
2183         * Modules/encryptedmedia/MediaKeySession.idl:
2184
2185             Replace custom promise code using the registerPromise idiom with DOMPromiseProxy.
2186
2187         * bindings/IDLTypes.h:
2188
2189             Add StorageType type alias to allow specifying a specific form for storage. This allows
2190             use to use Ref<> for interfaces in DOMPromiseProxy.
2191
2192         (WebCore::IDLWrapper::convertToParameterType):
2193             
2194             Also add convertToParameterType, an annoying hack to workaround the fact WTF::Function
2195             can't return references / no
2196
2197         * bindings/js/DOMPromiseProxy.h: Added.
2198         (WebCore::DOMPromiseProxy<IDLType>):
2199         
2200             DOMPromiseProxy is a new class (set of classes) to represent promises that works with the 
2201             standard toJS<> / JSDOMConvert infrastructure used by the bindings generator. From the
2202             implementation perspective, it is similar to DOMPromiseDeferred, but instead of receiving
2203             one as a parameter, you can initialize it directly in your constructor and start using it.
2204
2205             From the bindings perspective, a DOMPromiseProxy can be converted into a JS Promise by calling
2206             its promise function, which will either create a new promise, or return a cached one.
2207
2208             To make this work, DOMPromiseProxy maintains a Vector of DeferredPromises that hold onto those
2209             actualized promises. The reason it has a Vector, is that we need one DeferredPromises per
2210             DOMWrapperWorld, just like we need one wrapper for an interface per DOMWrapperWorld in the 
2211             wrapper cache. In most cases, only the normal world will be in play, so the Vector has an inline
2212             capacity of one.
2213             
2214             In addition, DOMPromiseProxy maintains a Variant of either an Exception or the result value type.
2215             This allows the DOMPromiseProxy to be resolved or rejected at anytime. Then, when the bindings
2216             request the promise, the stored result / exception can be resolved / rejected into the promise.
2217
2218         (WebCore::DOMPromiseProxy<IDLVoid>):
2219
2220             For void promises, we need slightly different semantics (resolve takes no parameters, Value is
2221             a bit indicating resolved state), so it is specialized.
2222
2223         (WebCore::DOMPromiseProxyWithResolveCallback<IDLType>):
2224
2225             In addition to the void specialization, we have DOMPromiseProxyWithResolveCallback. Instead of
2226             storing the value of the resolution directly, this specialization allows the owner to specify
2227             callback to be called when the resolved value is needed. This is needed to avoid reference
2228             cycles when the resolved value is the owner such as is the case with FontFace and FontFaceSet.
2229
2230         * bindings/js/JSDOMConvertPromise.h:
2231         (WebCore::JSConverter<IDLPromise<T>>::convert):
2232         Add converter that calls through to the DOMPromiseProxy function promise.
2233
2234         * bindings/js/JSDOMPromiseDeferred.cpp:
2235         (WebCore::DeferredPromise::callFunction):
2236         (WebCore::DeferredPromise::reject):
2237         * bindings/js/JSDOMPromiseDeferred.h:
2238         (WebCore::DeferredPromise::create):
2239         (WebCore::DeferredPromise::DeferredPromise):
2240
2241             Add a new create function for DeferredPromise that creates the JSPromiseDeferred for you.
2242             Also adds a mode to DeferredPromise to allow keeping the promise after resolution. Maintain
2243             the old behavior as the default.
2244
2245             Change reject to take an Exception as sink rather than an r-value, to allow DOMPromiseProxy
2246             to copy a Exception into multiple DeferredPromises. For callers already moving into reject,
2247             this should be no change.
2248
2249         * bindings/scripts/CodeGeneratorJS.pm:
2250         (AddToIncludesForIDLType):
2251         (GenerateParametersCheck):
2252         (GenerateImplementationFunctionCall):
2253         (NativeToJSValueDOMConvertNeedsState):
2254         (NativeToJSValueDOMConvertNeedsGlobalObject):
2255
2256             Add support DOMPromiseProxy. For now, this means a new extended attribute, [PromiseProxy],
2257             but once I convert all the existing promises over to using DOMPromiseProxy, it will be removed.
2258             
2259             Also specify the right #includes for promises and necessary parameters for conversion.
2260
2261         * bindings/scripts/IDLAttributes.json:
2262         
2263             Add [PromiseProxy], a temporary extended attribute for using DOMPromiseProxy.
2264
2265         * css/FontFace.cpp:
2266         * css/FontFace.h:
2267         * css/FontFace.idl:
2268         * css/FontFaceSet.cpp:
2269         * css/FontFaceSet.h:
2270         * css/FontFaceSet.idl:
2271
2272             Replace custom promise code using the registerPromise idiom with DOMPromiseProxyWithResolveCallback.
2273             The callback is necessary for these two classes since the value the resolve is themselves, and using
2274             a normal resolve would create a cycle.
2275
2276         * html/canvas/WebGPUCommandBuffer.cpp:
2277         * html/canvas/WebGPUCommandBuffer.h:
2278         * html/canvas/WebGPUCommandBuffer.idl:
2279         * platform/graphics/cocoa/GPUCommandBufferMetal.mm:
2280         * platform/graphics/gpu/GPUCommandBuffer.cpp:
2281         * platform/graphics/gpu/GPUCommandBuffer.h:
2282
2283             Replace custom promise code using the registerPromise idiom with DOMPromiseProxy.
2284
2285         * page/NavigatorBase.cpp:
2286         (WebCore::NavigatorBase::NavigatorBase):
2287         * page/NavigatorBase.h:
2288
2289             Forward declare ServiceWorkerContainer and add an explicit constructor to allow
2290             removing #include of ServiceWorkerContainer.h in the header, avoiding an #include cycle.
2291
2292         * workers/ServiceWorkerContainer.cpp:
2293         * workers/ServiceWorkerContainer.h:
2294         * workers/ServiceWorkerContainer.idl:
2295
2296             Replace custom promise code using the registerPromise idiom with DOMPromiseProxy.
2297
2298         * bindings/scripts/test/JS/JSTestObj.cpp:
2299         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
2300         * bindings/scripts/test/TestObj.idl:
2301
2302             Add / update tests.
2303
2304 2017-08-08  John Wilander  <wilander@apple.com>
2305
2306         Resource Load Statistics: Merge of dataRecordsRemoved should use std::max()
2307         https://bugs.webkit.org/show_bug.cgi?id=175348
2308         <rdar://problem/33785695>
2309
2310         Reviewed by Chris Dumez.
2311
2312         No new tests. Online change of a statistic that doesn't affect logic flow.
2313
2314         * loader/ResourceLoadStatistics.cpp:
2315         (WebCore::ResourceLoadStatistics::merge):
2316             Now uses std::max() instead of addition.
2317
2318 2017-08-08  Brent Fulgham  <bfulgham@apple.com>
2319
2320         Sandbox flags do not support document.domain control
2321         https://bugs.webkit.org/show_bug.cgi?id=175281
2322         <rdar://problem/33778936>
2323
2324         Reviewed by Chris Dumez.
2325
2326         Update the 'setDomain' logic to honor the sandbox properties as defined in the current
2327         HTML5 specification. This brings us in line with how Chrome and other browsers have
2328         worked for some time.
2329
2330         Test: fast/frames/sandboxed-iframe-domain.html
2331
2332         * dom/Document.cpp:
2333         (WebCore::Document::setDomain): Add check for sandbox flag (with appropriate error message)
2334         * dom/SecurityContext.h:
2335
2336 2017-08-08  Jeremy Jones  <jeremyj@apple.com>
2337
2338         Change fast seek logic to prevent ping-ponging.
2339         https://bugs.webkit.org/show_bug.cgi?id=175167
2340         rdar://problem/32936116
2341
2342         Reviewed by Jer Noble.
2343
2344         Updated test: media/video-fast-seek.html
2345
2346         Changed fast seek behavior to always seek early than seek time; and after current time when seeking forward.
2347         This prevents ping-ponging, where a fast seek overshoots the target looking for a keyframe.
2348         A subsequent seek will suddenly be on the other side of current time and
2349         will search in the opposite direction for a key frame; repeat.
2350
2351         * html/HTMLMediaElement.cpp:
2352         (WebCore::HTMLMediaElement::fastSeek):
2353
2354 2017-08-08  Ms2ger  <Ms2ger@igalia.com>
2355
2356         Unreviewed. Correct the function name in a debug message.
2357         https://bugs.webkit.org/show_bug.cgi?id=175262
2358
2359         No new tests: debug logs are not tested.
2360
2361         * platform/audio/PlatformMediaSessionManager.cpp:
2362         (WebCore::PlatformMediaSessionManager::applicationDidBecomeActive const):
2363
2364 2017-08-08  Brent Fulgham  <bfulgham@apple.com>
2365
2366         Unreviewed build fix after r220376.
2367
2368         Don't attempt to use isPublicSuffix when building without that
2369         feature enabled.
2370
2371         * dom/Document.cpp:
2372         (WebCore::Document::domainIsRegisterable const):
2373
2374 2017-08-08  Michael Catanzaro  <mcatanzaro@igalia.com>
2375
2376         [CMake] Properly test if compiler supports compiler flags
2377         https://bugs.webkit.org/show_bug.cgi?id=174490
2378
2379         Reviewed by Konstantin Tokarev.
2380
2381         * CMakeLists.txt:
2382         * PlatformGTK.cmake:
2383         * PlatformWPE.cmake:
2384
2385 2017-08-08  Zan Dobersek  <zdobersek@igalia.com>
2386
2387         [GStreamer] Don't use GraphicsContext3D in VideoTextureCoperGStreamer
2388         https://bugs.webkit.org/show_bug.cgi?id=174774
2389
2390         Reviewed by Carlos Garcia Campos.
2391
2392         VideoTextureCoperGStreamer class creates a new GraphicsContext3D internally
2393         that's used to render to whichever OpenGL context is current. Such usage
2394         doesn't add anything to the user since there's no underlying offscreen-based
2395         OpenGL context created, and instead all GraphicsContext3D calls are directly
2396         translated to usual OpenGL API calls. We should avoid using GraphicsContext3D
2397         in such cases and instead use direct OpenGL API calls.
2398
2399         This patch achieves that for the VideoTextureCoperGStreamer class. A
2400         GraphicsContext3D object is still created because it's needed to construct an
2401         instance of the TextureMapperShaderProgram class, but this will be removed as
2402         soon as TextureMapperShaderProgram drops the GraphicsContext3D dependence.
2403
2404         No new tests -- no change in behavior.
2405
2406         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
2407         (WebCore::VideoTextureCopierGStreamer::VideoTextureCopierGStreamer):
2408         (WebCore::VideoTextureCopierGStreamer::~VideoTextureCopierGStreamer):
2409         (WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture):
2410         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.h:
2411         (WebCore::VideoTextureCopierGStreamer::resultTexture):
2412
2413 2017-08-08  Zan Dobersek  <zdobersek@igalia.com>
2414
2415         [TexMap] Drop GC3D* type usage from TextureMapperPlatformLayer{Buffer,Proxy}
2416         https://bugs.webkit.org/show_bug.cgi?id=175314
2417
2418         Reviewed by Carlos Garcia Campos.
2419
2420         Switch to using OpenGL types in the TextureMapperPlatformLayerBuffer and
2421         TextureMapperPlatformLayerProxy classes, instead of the equivalent GC3D*
2422         types provided in the GraphicsTypes3D.h header.
2423
2424         No new tests -- no change in behavior.
2425
2426         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
2427         (WebCore::TextureMapperPlatformLayerBuffer::TextureMapperPlatformLayerBuffer):
2428         (WebCore::TextureMapperPlatformLayerBuffer::canReuseWithoutReset):
2429         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
2430         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
2431         (WebCore::TextureMapperPlatformLayerProxy::getAvailableBuffer):
2432         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
2433
2434 2017-08-08  Zan Dobersek  <zdobersek@igalia.com>
2435
2436         [TexMap] Don't use GraphicsContext3D in ClipStack
2437         https://bugs.webkit.org/show_bug.cgi?id=174776
2438
2439         Reviewed by Carlos Garcia Campos.
2440
2441         Any GraphicsContext3D object that's passed to ClipStack methods is of the
2442         render-to-current-context nature, meaning there's no internally owned GL
2443         context that has to be properly handled and all calls are simply passed to
2444         OpenGL APIs. We should drop such (non-)usage of GraphicsContext3D in favor
2445         of direct OpenGL API invocations.
2446
2447         This patch covers TextureMapper's ClipStack. Call sites to the apply() and
2448         applyIfNeeded() are modified to not pass a reference to any
2449         GraphicsContext3D object. Internally, OpenGL API entrypoints and constants
2450         are used instead of GraphicsContext3D invocations.
2451
2452         No new tests -- no change in behavior.
2453
2454         * platform/graphics/texmap/BitmapTextureGL.cpp:
2455         (WebCore::BitmapTextureGL::clearIfNeeded):
2456         (WebCore::BitmapTextureGL::bindAsSurface):
2457         * platform/graphics/texmap/ClipStack.cpp:
2458         (WebCore::ClipStack::apply):
2459         (WebCore::ClipStack::applyIfNeeded):
2460         * platform/graphics/texmap/ClipStack.h:
2461         * platform/graphics/texmap/TextureMapperGL.cpp:
2462         (WebCore::TextureMapperGL::bindDefaultSurface):
2463         (WebCore::TextureMapperGL::beginScissorClip):
2464         (WebCore::TextureMapperGL::beginClip):
2465         (WebCore::TextureMapperGL::endClip):
2466
2467 2017-08-08  Javier Fernandez  <jfernandez@igalia.com>
2468
2469         Not possible to remove the 'li' element inside the table cell
2470         https://bugs.webkit.org/show_bug.cgi?id=173148
2471
2472         Reviewed by Ryosuke Niwa.
2473
2474         We need to add a new case for breaking out empty list items when they are
2475         at the start of an editable area. Since list items can be also inside
2476         table cells, we need to consider this kind of elements as well.
2477
2478         Tests: editing/deleting/delete-list-items-in-table-cell-1.html
2479                editing/deleting/delete-list-items-in-table-cell-2.html
2480                editing/deleting/delete-list-items-in-table-cell-3.html
2481                editing/deleting/delete-list-items-in-table-cell-4.html
2482                editing/deleting/delete-list-items-in-table-cell-5.html
2483                editing/deleting/delete-list-items-in-table-cell-6.html
2484                editing/deleting/delete-list-items-in-table-cell-7.html
2485                editing/deleting/delete-list-items-in-table-cell-8.html
2486
2487         * editing/TypingCommand.cpp:
2488         (WebCore::TypingCommand::deleteKeyPressed):
2489
2490 2017-08-08  Zan Dobersek  <zdobersek@igalia.com>
2491
2492         [TexMap] Isolate the TextureMapperPlatformLayerProxyProvider class
2493         https://bugs.webkit.org/show_bug.cgi?id=175316
2494
2495         Reviewed by Carlos Garcia Campos.
2496
2497         Move the TextureMapperPlatformLayerProxyProvider class (which is the type
2498         aliased to PlatformLayer for threaded CoordGraphics) into its own header
2499         file. This prevents including the TextureMapperPlatformLayerProxy.h header
2500         file in MediaPlayerPrivateGStreamerBase.h, avoiding spilling OpenGL types
2501         and function declarations before the GStreamer GL headers include them
2502         later in the MediaPlayerPrivateGStreamerBase implementation file.
2503
2504         In the MediaPlayerPrivateGStreamerBase.h header file, only the new header
2505         is included, and a forward declaration of the TextureMapperPlatformLayerProxy
2506         class is used. proxy() and swapBuffersIfNeeded() methods are moved into
2507         the implementation file to avoid requiring the full definition of the
2508         TextureMapperPlatformLayerProxy class.
2509
2510         Similar is done for the TextureMapperGC3DPlatformLayer class and the
2511         Cairo-specific implementation of the ImageBufferData class. The
2512         CoordinatedGraphicsLayer implementation file also gains an include of the
2513         TextureMapperPlatformLayerProxyProvider.h header since it requires the full
2514         definition of that class.
2515
2516         No new tests -- no change in behavior.
2517
2518         * platform/graphics/cairo/ImageBufferCairo.cpp:
2519         (WebCore::ImageBufferData::proxy const):
2520         * platform/graphics/cairo/ImageBufferDataCairo.h:
2521         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2522         (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture):
2523         (WebCore::MediaPlayerPrivateGStreamerBase::proxy const):
2524         (WebCore::MediaPlayerPrivateGStreamerBase::swapBuffersIfNeeded):
2525         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2526         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp:
2527         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h:
2528         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
2529         * platform/graphics/texmap/TextureMapperPlatformLayerProxyProvider.h: Added.
2530         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2531
2532 2017-08-08  Zan Dobersek  <zdobersek@igalia.com>
2533
2534         Unreviewed. Follow-up to r220392 that fixes build on configurations
2535         that disable USE(GSTREAMER_GL).
2536
2537         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2538         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
2539         When creating the BitmapTextureGL object, also provide an initialized
2540         TextureMapperContextAttributes object.
2541
2542 2017-08-08  Zan Dobersek  <zdobersek@igalia.com>
2543
2544         [TexMap] Group GL header file inclusions in a single header file
2545         https://bugs.webkit.org/show_bug.cgi?id=175313
2546
2547         Reviewed by Carlos Garcia Campos.
2548
2549         Add a helper header file to the TextureMapper subsystem that includes
2550         the OpenGL headers, properly addressing the build configuration to
2551         include headers as provided by either libepoxy, the OpenGL ES library,
2552         or the OpenGL library.
2553
2554         TextureMapperContextAttributes implementation file is the only one
2555         that can leverage the header at the moment, but more will follow.
2556
2557         * platform/graphics/texmap/TextureMapperContextAttributes.cpp:
2558         * platform/graphics/texmap/TextureMapperGLHeaders.h: Copied from Source/WebCore/platform/graphics/texmap/TextureMapperContextAttributes.cpp.
2559
2560 2017-08-08  Wenson Hsieh  <wenson_hsieh@apple.com>
2561
2562         [iOS WK2] WKWebView schedules nonstop layout after pressing cmb+b,i,u inside a contenteditable div
2563         https://bugs.webkit.org/show_bug.cgi?id=175116
2564         <rdar://problem/28279301>
2565
2566         Reviewed by Darin Adler and Ryosuke Niwa.
2567
2568         WebCore support for WebPage::editorState refactoring. See WebKit ChangeLogs for more detail.
2569
2570         Tests: EditorStateTests.TypingAttributesBold
2571                EditorStateTests.TypingAttributesItalic
2572                EditorStateTests.TypingAttributesUnderline
2573                EditorStateTests.TypingAttributesTextAlignmentAbsoluteAlignmentOptions
2574                EditorStateTests.TypingAttributesTextAlignmentStartEnd
2575                EditorStateTests.TypingAttributesTextAlignmentDirectionalText
2576                EditorStateTests.TypingAttributesTextColor
2577                EditorStateTests.TypingAttributesMixedStyles
2578                EditorStateTests.TypingAttributesLinkColor
2579
2580         * css/StyleProperties.cpp:
2581         (WebCore::StyleProperties::propertyAsColor const):
2582         (WebCore::StyleProperties::propertyAsValueID const):
2583
2584         Introduces some helper functions in StyleProperties to convert CSS property values to Color or a CSSValueID.
2585
2586         * css/StyleProperties.h:
2587         * editing/EditingStyle.cpp:
2588         (WebCore::EditingStyle::hasStyle):
2589
2590         Pull out logic in selectionStartHasStyle that asks for a style TriState into EditingStyle::hasStyle. This is
2591         because WebPage::editorState will now query for multiple styles at the selection start, but
2592         selectionStartHasStyle currently recomputes styleAtSelectionStart every time it is called. To prevent extra work
2593         from being done, we can just call selectionStartHasStyle once and use ask for EditingStyle::hasStyle on the
2594         computed EditingStyle at selection start.
2595
2596         * editing/EditingStyle.h:
2597         * editing/Editor.cpp:
2598         (WebCore::Editor::selectionStartHasStyle const):
2599
2600 2017-08-08  Zan Dobersek  <zdobersek@igalia.com>
2601
2602         [TexMap] Add TextureMapperContextAttributes
2603         https://bugs.webkit.org/show_bug.cgi?id=175311
2604
2605         Reviewed by Carlos Garcia Campos.
2606
2607         Add and use TextureMapperContextAttributes, a slim struct that holds
2608         information about the type and extensions supported by the OpenGL
2609         context that's being used for one specific TextureMapperGL instance.
2610
2611         This struct is initialized in the TextureMapperGL constructor for the
2612         OpenGL context that's been made current on that thread, and that will
2613         be used for that TextureMapperGL instance through its lifetime. The
2614         struct is then also copied into any BitmapTextureGL objects that have
2615         been created through this TextureMapperGL (or its texture pool).
2616
2617         The struct is initialized with information about GLES2 support (which
2618         is at this point done through the USE_OPENGL_ES_2 macro) and about
2619         specific OpenGL extensions that are supported. These are then used in
2620         TextureMapperGL (NPOT textures) and BitmapTextureGL (BGRA support,
2621         sub-image unpacking) to deploy specific optimizations or workarounds.
2622
2623         This ultimately serves as a replacement for clunky static functions
2624         that need to operate on GraphicsContext3D objects to retrieve this
2625         information.
2626
2627         No new tests -- no change in behavior.
2628
2629         * platform/TextureMapper.cmake:
2630         * platform/graphics/texmap/BitmapTextureGL.cpp:
2631         (WebCore::BitmapTextureGL::BitmapTextureGL):
2632         (WebCore::BitmapTextureGL::updateContentsNoSwizzle):
2633         (WebCore::BitmapTextureGL::updateContents):
2634         (WebCore::driverSupportsSubImage): Deleted.
2635         * platform/graphics/texmap/BitmapTextureGL.h:
2636         (WebCore::BitmapTextureGL::create):
2637         * platform/graphics/texmap/BitmapTexturePool.cpp:
2638         (WebCore::BitmapTexturePool::BitmapTexturePool):
2639         (WebCore::BitmapTexturePool::createTexture):
2640         * platform/graphics/texmap/BitmapTexturePool.h:
2641         * platform/graphics/texmap/TextureMapperContextAttributes.cpp: Added.
2642         (WebCore::TextureMapperContextAttributes::initialize):
2643         * platform/graphics/texmap/TextureMapperContextAttributes.h: Added.
2644         * platform/graphics/texmap/TextureMapperGL.cpp:
2645         (WebCore::TextureMapperGL::TextureMapperGL):
2646         (WebCore::TextureMapperGL::drawTexture):
2647         (WebCore::TextureMapperGL::drawTexturedQuadWithProgram):
2648         (WebCore::TextureMapperGL::createTexture):
2649         (WebCore::driverSupportsNPOTTextures): Deleted.
2650         * platform/graphics/texmap/TextureMapperGL.h:
2651
2652 2017-08-08  Zan Dobersek  <zdobersek@igalia.com>
2653
2654         [TexMap] Don't expose GraphicsContext3D object
2655         https://bugs.webkit.org/show_bug.cgi?id=175310
2656
2657         Reviewed by Carlos Garcia Campos.
2658
2659         Remove the GraphicsContext3D getter from the TextureMapperGL class. Instead,
2660         the clearColor() method is added that's to be used by the CoordinatedGraphicsScene
2661         class which was accessing the GraphicsContext3D object for this purpose.
2662
2663         * platform/graphics/texmap/TextureMapper.h:
2664         * platform/graphics/texmap/TextureMapperGL.cpp:
2665         (WebCore::TextureMapperGL::clearColor):
2666         * platform/graphics/texmap/TextureMapperGL.h:
2667         (WebCore::TextureMapperGL::graphicsContext3D const): Deleted.
2668
2669 2017-08-07  Simon Fraser  <simon.fraser@apple.com>
2670
2671         RenderStyle:diff() was inadvertently doing deep compares of StyleRareNonInheritedData etc
2672         https://bugs.webkit.org/show_bug.cgi?id=175304
2673
2674         Reviewed by Tim Horton.
2675
2676         r210758 changed DataRef::get() from returning a pointer to a reference. This caused all the places
2677         in RenderStyle::diff() and related functions, where we intended to do a quick pointer comparison,
2678         to doing deep compares via operator!=. This made the code slightly slower.
2679
2680         Fix by exposing ptr() on DataRef and using it wherever we wish to do pointer comparison.
2681
2682         * rendering/style/DataRef.h:
2683         (WebCore::DataRef::ptr const):
2684         * rendering/style/RenderStyle.cpp:
2685         (WebCore::RenderStyle::inheritedDataShared const):
2686         (WebCore::RenderStyle::changeAffectsVisualOverflow const):
2687         (WebCore::RenderStyle::changeRequiresLayout const):
2688         (WebCore::RenderStyle::changeRequiresRecompositeLayer const):
2689         (WebCore::RenderStyle::listStyleImage const): Expand the function onto multiple lines.
2690
2691 2017-08-07  Simon Fraser  <simon.fraser@apple.com>
2692
2693         Add a fast path for rotate() and rotateZ() transform parsing
2694         https://bugs.webkit.org/show_bug.cgi?id=175308
2695
2696         Reviewed by Zalan Bujtas.
2697
2698         Fast paths only existed for translate-related functions, matrix3d() and scale3d(). Add
2699         rotate() and rotateX(), which gives a small boost to one of the MotionMark tests.
2700
2701         * css/parser/CSSParserFastPaths.cpp:
2702         (WebCore::parseSimpleAngle):
2703         (WebCore::parseTransformAngleArgument):
2704         (WebCore::parseSimpleTransformValue):
2705         (WebCore::transformCanLikelyUseFastPath):
2706
2707 2017-08-07  Simon Fraser  <simon.fraser@apple.com>
2708
2709         Re-order the tests in RenderLayerCompositor::requiresCompositingLayer() for performance
2710         https://bugs.webkit.org/show_bug.cgi?id=175306
2711
2712         Reviewed by Tim Horton.
2713
2714         Re-order the tests for compositing reasons so that reasons more likely to happen are higher in the list.
2715
2716         * rendering/RenderLayerCompositor.cpp:
2717         (WebCore::RenderLayerCompositor::requiresCompositingLayer const):
2718         (WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
2719
2720 2017-08-07  Simon Fraser  <simon.fraser@apple.com>
2721
2722         Avoid a hash lookup in FilterInfo::remove()
2723         https://bugs.webkit.org/show_bug.cgi?id=175301
2724
2725         Reviewed by Sam Weinig.
2726
2727         FilterInfo::remove() always called map().remove(&layer)), even when layer.m_hasFilterInfo
2728         was false (and even asserted that layer.m_hasFilterInfo == map().contains(&layer)).
2729
2730         So we can early return if layer.m_hasFilterInfo is false.
2731
2732         * rendering/RenderLayerFilterInfo.cpp:
2733         (WebCore::RenderLayer::FilterInfo::getIfExists):
2734         (WebCore::RenderLayer::FilterInfo::remove):
2735
2736 2017-08-07  Simon Fraser  <simon.fraser@apple.com>
2737
2738         Make TransformOperation::type() non-virtual
2739         https://bugs.webkit.org/show_bug.cgi?id=175297
2740
2741         Reviewed by Sam Weinig.
2742
2743         Store the OperationType in the base class so that type() and isSameType() can
2744         be non-virtual.
2745
2746         Small perf win on some benchmarks.
2747
2748         * platform/graphics/transforms/IdentityTransformOperation.h:
2749         * platform/graphics/transforms/Matrix3DTransformOperation.h:
2750         * platform/graphics/transforms/MatrixTransformOperation.h:
2751         * platform/graphics/transforms/PerspectiveTransformOperation.h:
2752         * platform/graphics/transforms/RotateTransformOperation.cpp:
2753         (WebCore::RotateTransformOperation::blend):
2754         * platform/graphics/transforms/RotateTransformOperation.h:
2755         * platform/graphics/transforms/ScaleTransformOperation.cpp:
2756         (WebCore::ScaleTransformOperation::blend):
2757         * platform/graphics/transforms/ScaleTransformOperation.h:
2758         * platform/graphics/transforms/SkewTransformOperation.cpp:
2759         (WebCore::SkewTransformOperation::blend):
2760         * platform/graphics/transforms/SkewTransformOperation.h:
2761         * platform/graphics/transforms/TransformOperation.h:
2762         (WebCore::TransformOperation::TransformOperation):
2763         (WebCore::TransformOperation::type const):
2764         (WebCore::TransformOperation::isSameType const):
2765         * platform/graphics/transforms/TranslateTransformOperation.cpp:
2766         (WebCore::TranslateTransformOperation::blend):
2767         * platform/graphics/transforms/TranslateTransformOperation.h:
2768
2769 2017-08-07  Simon Fraser  <simon.fraser@apple.com>
2770
2771         Inline ~Color and Color::isExtended()
2772         https://bugs.webkit.org/show_bug.cgi?id=175293
2773
2774         Reviewed by Zalan Bujtas.
2775
2776         The Color destructor and Color::isExtended() show up on profiles, so inline them.
2777         Before r207265 the destructor was inlined.
2778         
2779         Also make sure that LengthSize::operator== is inlined, which it was not (according
2780         to profiles).
2781
2782         * platform/LengthSize.h:
2783         (WebCore::operator==):
2784         * platform/graphics/Color.cpp:
2785         (WebCore::Color::~Color): Deleted.
2786         (WebCore::Color::isExtended const): Deleted.
2787         * platform/graphics/Color.h:
2788         (WebCore::Color::~Color):
2789         (WebCore::Color::isExtended const):
2790
2791 2017-08-04  Brent Fulgham  <bfulgham@apple.com>
2792
2793         Implement the HTML5 same-origin restriction specification
2794         https://bugs.webkit.org/show_bug.cgi?id=175226
2795         <rdar://problem/11079948>
2796
2797         Reviewed by Chris Dumez.
2798
2799         Follow the algorithms defined in the HTML5 specification for relaxing
2800         the same-origin restriction. We were missing a few steps related to
2801         checking for public suffix and presence of a browsing context.
2802
2803         Tested by new TestWebKitAPI tests.
2804
2805         * dom/Document.cpp:
2806         (WebCore::Document::domainIsRegisterable): Added helper function.
2807         (WebCore::Document::setDomain):
2808
2809 2017-08-07  Devin Rousso  <drousso@apple.com>
2810
2811         Web Inspector: Preview Canvas path when viewing a recording
2812         https://bugs.webkit.org/show_bug.cgi?id=174967
2813
2814         Reviewed by Brian Burg.
2815
2816         Tests: fast/canvas/2d.currentPoint.html
2817                fast/canvas/2d.getPath.modification.html
2818                fast/canvas/2d.getPath.newobject.html
2819                fast/canvas/2d.setPath.html
2820
2821         * html/canvas/CanvasPath.idl:
2822         * html/canvas/CanvasPath.h:
2823         * html/canvas/CanvasPath.cpp:
2824         (WebCore::CanvasPath::currentX const):
2825         (WebCore::CanvasPath::currentY const):
2826
2827         * html/canvas/CanvasRenderingContext2D.idl:
2828         * html/canvas/CanvasRenderingContext2D.h:
2829         * html/canvas/CanvasRenderingContext2D.cpp:
2830         (WebCore::CanvasRenderingContext2D::setPath):
2831         (WebCore::CanvasRenderingContext2D::getPath const):
2832
2833         * page/RuntimeEnabledFeatures.h:
2834         (WebCore::RuntimeEnabledFeatures::setInspectorAdditionsEnabled):
2835         (WebCore::RuntimeEnabledFeatures::inspectorAdditionsEnabled const):
2836         Add runtime flag for added IDL items above so that they are only usable within the inspector
2837         process. The runtime flag is not enabled from anywhere else as of now.
2838
2839         * inspector/InspectorCanvas.cpp:
2840         (WebCore::InspectorCanvas::buildInitialState):
2841         Send current path as part of the InitialState.
2842         Drive-by: deduplicate more string values.
2843
2844 2017-08-07  Chris Dumez  <cdumez@apple.com>
2845
2846         Update sendBeacon() to rely on FetchBody instead of the whole FetchRequest
2847         https://bugs.webkit.org/show_bug.cgi?id=175280
2848
2849         Reviewed by Youenn Fablet.
2850
2851         Update sendBeacon() to rely on FetchBody instead of the whole FetchRequest. FetchBody
2852         for data extraction is really the only thing we need at the moment.
2853         The new code also properly sets the CORS mode, which will be needed for Bug 175264.
2854
2855         * Modules/beacon/NavigatorBeacon.cpp:
2856         (WebCore::NavigatorBeacon::sendBeacon):
2857
2858 2017-08-07  Michael Catanzaro  <mcatanzaro@igalia.com>
2859
2860         -Wimplicit-fallthrough warning in ComputedStyleExtractor::propertyValue
2861         https://bugs.webkit.org/show_bug.cgi?id=174469
2862         <rdar://problem/33311638>
2863
2864         Reviewed by Simon Fraser.
2865
2866         Add a RELEASE_ASSERT_NOT_REACHED to silence this warning.
2867
2868         * css/CSSComputedStyleDeclaration.cpp:
2869         (WebCore::ComputedStyleExtractor::propertyValue):
2870
2871 2017-08-06  Filip Pizlo  <fpizlo@apple.com>
2872
2873         Primitive auxiliaries and JSValue auxiliaries should have separate gigacages
2874         https://bugs.webkit.org/show_bug.cgi?id=174919
2875
2876         Reviewed by Keith Miller.
2877
2878         No new tests because no change in behavior.
2879         
2880         Adapting to API changes - we now specify the AlignedMemoryAllocator differently and we need to be
2881         specific about which Gigacage we're using.
2882
2883         * bindings/js/WebCoreJSClientData.cpp:
2884         (WebCore::JSVMClientData::JSVMClientData):
2885         * platform/graphics/cocoa/GPUBufferMetal.mm:
2886         (WebCore::GPUBuffer::GPUBuffer):
2887
2888 2017-08-07  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2889
2890         [Curl] Add abstraction layer of cookie jar implementation for Curl port
2891         https://bugs.webkit.org/show_bug.cgi?id=174943
2892
2893         Reviewed by Brent Fulgham.
2894
2895         * platform/network/curl/CookieJarCurl.cpp:
2896         (WebCore::CookieJarCurlFileSystem::setCookiesFromDOM):
2897         (WebCore::CookieJarCurlFileSystem::cookiesForDOM):
2898         (WebCore::CookieJarCurlFileSystem::cookieRequestHeaderFieldValue):
2899         (WebCore::CookieJarCurlFileSystem::cookiesEnabled):
2900         (WebCore::CookieJarCurlFileSystem::getRawCookies):
2901         (WebCore::CookieJarCurlFileSystem::deleteCookie):
2902         (WebCore::CookieJarCurlFileSystem::getHostnamesWithCookies):
2903         (WebCore::CookieJarCurlFileSystem::deleteCookiesForHostnames):
2904         (WebCore::CookieJarCurlFileSystem::deleteAllCookies):
2905         (WebCore::CookieJarCurlFileSystem::deleteAllCookiesModifiedSince):
2906         (WebCore::cookiesForDOM):
2907         (WebCore::setCookiesFromDOM):
2908         (WebCore::cookieRequestHeaderFieldValue):
2909         (WebCore::cookiesEnabled):
2910         (WebCore::getRawCookies):
2911         (WebCore::deleteCookie):
2912         (WebCore::getHostnamesWithCookies):
2913         (WebCore::deleteCookiesForHostnames):
2914         (WebCore::deleteAllCookies):
2915         (WebCore::deleteAllCookiesModifiedSince):
2916         * platform/network/curl/CookieJarCurl.h: Added.
2917         * platform/network/curl/CurlContext.cpp:
2918         * platform/network/curl/CurlContext.h:
2919         (WebCore::CurlContext::cookieJar):
2920
2921 2017-08-07  Brady Eidson  <beidson@apple.com>
2922
2923         Implement most of ServiceWorkerContainer::addRegistration.
2924         https://bugs.webkit.org/show_bug.cgi?id=175237
2925
2926         Reviewed by Andy Estes.
2927
2928         No new tests (Covered by changes to existing tests).
2929
2930         There's still so much supporting infrastructure to add with these early patches
2931         that I'm still moving them in baby steps for now, hence not implementing
2932         register() all in one shot.
2933         
2934         Things will start moving very quickly once we no longer need to add lots of new
2935         primitives in each change.
2936         
2937         * CMakeLists.txt:
2938         * DerivedSources.make:
2939         * WebCore.xcodeproj/project.pbxproj:
2940         
2941         * page/DOMWindow.cpp:
2942         (WebCore::DOMWindow::navigator const):
2943         
2944         * page/Navigator.cpp:
2945         (WebCore::Navigator::Navigator): Make the constructor take a ScriptExecutionContext for 
2946           creation of objects where its import (e.g. ServiceWorkerContainer).
2947         * page/Navigator.h:
2948
2949         * page/WorkerNavigator.cpp:
2950         (WebCore::WorkerNavigator::WorkerNavigator): Ditto.
2951         * page/WorkerNavigator.h:
2952
2953         * page/NavigatorBase.cpp:
2954         (WebCore::NavigatorBase::NavigatorBase): Create the ServiceWorkerContainer upfront with
2955           the passed-in ScriptExecutionContext.
2956         (WebCore::NavigatorBase::serviceWorker):
2957         * page/NavigatorBase.h:
2958         
2959         Make ServiceWorkerContainer into an ActiveDOMObject. This will eventually be necessary for
2960         Document suspension reasons, but is also necessary because it also needs to be a
2961         ContextDestructionObserver (which ActiveDOMObject is):
2962         * workers/ServiceWorkerContainer.cpp:
2963         (WebCore::ServiceWorkerContainer::ServiceWorkerContainer):
2964         (WebCore::ServiceWorkerContainer::ready):
2965         (WebCore::ServiceWorkerContainer::addRegistration):
2966         (WebCore::ServiceWorkerContainer::getRegistration):
2967         (WebCore::ServiceWorkerContainer::getRegistrations):
2968         (WebCore::ServiceWorkerContainer::activeDOMObjectName const):
2969         (WebCore::ServiceWorkerContainer::canSuspendForDocumentSuspension const):
2970         (WebCore::rejectLater): Deleted.
2971         (WebCore::ServiceWorkerContainer::eventTargetInterface const): Deleted.
2972         (WebCore::ServiceWorkerContainer::scriptExecutionContext const): Deleted.
2973         * workers/ServiceWorkerContainer.h:
2974         * workers/ServiceWorkerContainer.idl:
2975
2976         Add updateViaCache, etc:
2977         * workers/ServiceWorkerRegistration.cpp:
2978         (WebCore::ServiceWorkerRegistration::updateViaCache const):
2979         (WebCore::ServiceWorkerRegistration::update):
2980         (WebCore::ServiceWorkerRegistration::unregister):
2981         * workers/ServiceWorkerRegistration.h:
2982         * workers/ServiceWorkerRegistration.idl:
2983
2984         * workers/ServiceWorkerUpdateViaCache.h: Copied from Source/WebCore/workers/ServiceWorkerRegistration.idl.
2985         * workers/ServiceWorkerUpdateViaCache.idl: Copied from Source/WebCore/workers/ServiceWorkerRegistration.idl.
2986
2987         * workers/WorkerGlobalScope.cpp:
2988         (WebCore::WorkerGlobalScope::navigator):
2989         (WebCore::WorkerGlobalScope::navigator const): Deleted.
2990         * workers/WorkerGlobalScope.h:
2991
2992         * workers/WorkerType.h: Copied from Source/WebCore/workers/ServiceWorkerRegistration.idl.
2993         * workers/WorkerType.idl: Copied from Source/WebCore/workers/ServiceWorkerRegistration.idl.
2994
2995 2017-08-07  Ryan Haddad  <ryanhaddad@apple.com>
2996
2997         Unreviewed, rolling out r220299.
2998
2999         This change caused LayoutTest inspector/dom-debugger/dom-
3000         breakpoints.html to fail.
3001
3002         Reverted changeset:
3003
3004         "Web Inspector: capture async stack trace when workers/main
3005         context posts a message"
3006         https://bugs.webkit.org/show_bug.cgi?id=167084
3007         http://trac.webkit.org/changeset/220299
3008
3009 2017-08-07  Brian Burg  <bburg@apple.com>
3010
3011         Cleanup: simplify WebSockets code for RuntimeEnabledFeatures
3012         https://bugs.webkit.org/show_bug.cgi?id=175190
3013
3014         Reviewed by Sam Weinig.
3015
3016         This runtime enabled flag is not used by anything. It was added
3017         for V8 in <https://bugs.webkit.org/show_bug.cgi?id=29896>.
3018
3019         * Modules/websockets/WebSocket.cpp:
3020         (WebCore::WebSocket::setIsAvailable): Deleted.
3021         (WebCore::WebSocket::isAvailable): Deleted.
3022         * Modules/websockets/WebSocket.h:
3023         * Modules/websockets/WebSocket.idl:
3024         * page/RuntimeEnabledFeatures.cpp:
3025         (WebCore::RuntimeEnabledFeatures::webSocketEnabled const): Deleted.
3026         * page/RuntimeEnabledFeatures.h:
3027
3028 2017-08-07  Brian Burg  <bburg@apple.com>
3029
3030         Remove CANVAS_PATH compilation guard
3031         https://bugs.webkit.org/show_bug.cgi?id=175207
3032
3033         Reviewed by Sam Weinig.
3034
3035         * Configurations/FeatureDefines.xcconfig:
3036         * html/canvas/DOMPath.h:
3037         * html/canvas/DOMPath.idl:
3038
3039 2017-08-07  Carlos Alberto Lopez Perez  <clopez@igalia.com>
3040
3041         [WPE][CMake] Only pass pkg-config CFLAGS from (E)GL when not using libepoxy.
3042         https://bugs.webkit.org/show_bug.cgi?id=175125
3043
3044         Reviewed by Michael Catanzaro.
3045
3046         No change of behavior, covered by existing tests.
3047
3048         * CMakeLists.txt: Instead of negating 3 times the use of libepoxy
3049         move the logic for (E)GL detection inside an else() block.
3050
3051 2017-08-07  Antti Koivisto  <antti@apple.com>
3052
3053         REGRESSION (r219121): Airmail 3 prints header part only.
3054         https://bugs.webkit.org/show_bug.cgi?id=175258
3055         <rdar://problem/33601173>
3056
3057         Reviewed by Andreas Kling.
3058
3059         When a WK1 WebViw is printed via AppKit view hierarchy it won't explictly set the page width
3060         but uses the existing width. r219121 assumes that all printing code paths set the page width.
3061
3062         No test, there appears to be no good way to test AppKit printing behaviors without adding complicated
3063         new testing infrastructure.
3064
3065         * rendering/RenderView.cpp:
3066         (WebCore::RenderView::layout):
3067
3068             If we are in printing layout and don't have page width set yet then use the current view width.
3069             This matches the behavior prior r219121.
3070
3071 2017-08-05  Youenn Fablet  <youenn@apple.com>
3072
3073         [Fetch API] Response should keep all ResourceResponse information
3074         https://bugs.webkit.org/show_bug.cgi?id=175099
3075
3076         Reviewed by Sam Weinig.
3077
3078         No change of behavior, covered by existing tests.
3079
3080         Disabling filtering of resource response at DocumentThreadableLoader for fetch API and doing the filtering at FetchResponse level.
3081         This requires passing the tainting parameter to FetchResponse. For that purpose, we store the tainting on the ResourceResponse itself.
3082         This allows mimicking the concept of internal response from the fetch spec.
3083         This might be useful for future developments related to caching the responses.
3084
3085         The body is now also stored in FetchResponse so a flag is added to ensure we only expose the body if allowed.
3086
3087         Changing storage of opaque redirect information to keep the redirection information in the response.
3088
3089         * Modules/fetch/FetchBodyOwner.cpp:
3090         (WebCore::FetchBodyOwner::blob):
3091         (WebCore::FetchBodyOwner::consumeNullBody):
3092         * Modules/fetch/FetchBodyOwner.h:
3093         * Modules/fetch/FetchLoader.cpp:
3094         (WebCore::FetchLoader::start):
3095         * Modules/fetch/FetchResponse.cpp:
3096         (WebCore::FetchResponse::BodyLoader::didReceiveResponse):
3097         (WebCore::FetchResponse::consume):
3098         (WebCore::FetchResponse::consumeBodyAsStream):
3099         (WebCore::FetchResponse::createReadableStreamSource):
3100         * Modules/fetch/FetchResponse.h:
3101         * loader/DocumentThreadableLoader.cpp:
3102         (WebCore::DocumentThreadableLoader::responseReceived):
3103         (WebCore::DocumentThreadableLoader::didReceiveResponse):
3104         (WebCore::DocumentThreadableLoader::didFinishLoading):
3105         (WebCore::DocumentThreadableLoader::loadRequest):
3106         * loader/DocumentThreadableLoader.h:
3107         * loader/SubresourceLoader.cpp:
3108         (WebCore::SubresourceLoader::willSendRequestInternal):
3109         * loader/cache/CachedResource.cpp:
3110         (WebCore::CachedResource::setBodyDataFrom):
3111         (WebCore::CachedResource::setResponse):
3112         * platform/network/ResourceResponseBase.cpp:
3113         (WebCore::ResourceResponseBase::crossThreadData const):
3114         (WebCore::ResourceResponseBase::fromCrossThreadData):
3115         (WebCore::ResourceResponseBase::filter):
3116         * platform/network/ResourceResponseBase.h:
3117         (WebCore::ResourceResponseBase::setTainting):
3118         (WebCore::ResourceResponseBase::tainting const):
3119         (WebCore::ResourceResponseBase::encode const):
3120         (WebCore::ResourceResponseBase::decode):
3121
3122 2017-08-05  Carlos Garcia Campos  <cgarcia@igalia.com>
3123
3124         WebDriver: use in-view center point for clicks instead of bounding box center point
3125         https://bugs.webkit.org/show_bug.cgi?id=174863
3126
3127         Reviewed by Simon Fraser.
3128
3129         Make DOMRect, and FloatPoint::narrowPrecision() available to WebKit layer. Also add
3130         FrameView::clientToDocumentPoint().
3131
3132         * WebCore.xcodeproj/project.pbxproj:
3133         * dom/Element.h:
3134         * page/FrameView.h:
3135         * platform/graphics/FloatPoint.h:
3136
3137 2017-08-05  Carlos Garcia Campos  <cgarcia@igalia.com>
3138
3139         getClientRects doesn't work with list box option elements
3140         https://bugs.webkit.org/show_bug.cgi?id=175016
3141
3142         Reviewed by Darin Adler.
3143
3144         Since HTMLOptionElement and HTMLOptGroupElement don't have a renderer, we are always returning an empty list
3145         from getClientRects. This is working fine in both chromium and firefox, option elements return its own bounding
3146         box and group elements return the bounding box of the group label and all its children items.
3147
3148         Test: fast/dom/HTMLSelectElement/listbox-items-client-rects.html
3149
3150         * dom/Element.cpp:
3151         (WebCore::listBoxElementBoundingBox): Helper function to return the bounding box of a HTMLOptionElement or
3152         HTMLOptGroupElement element.
3153         (WebCore::Element::getClientRects): Use listBoxElementBoundingBox() in case of HTMLOptionElement or
3154         HTMLOptGroupElement.
3155         (WebCore::Element::boundingClientRect): Ditto.
3156
3157 2017-08-04  Youenn Fablet  <youenn@apple.com>
3158
3159         [Cache API] Add Cache and CacheStorage IDL definitions
3160         https://bugs.webkit.org/show_bug.cgi?id=175201
3161
3162         Reviewed by Brady Eidson.
3163
3164         Covered by activated tests.
3165         Adding IDLs as per https://www.w3.org/TR/service-workers-1/#idl-index.
3166         Implementation is guarded by a runtime flag which is off by default.
3167         It is off for DRT but on for WTR.
3168
3169         * CMakeLists.txt:
3170         * DerivedSources.make:
3171         * Modules/cache/Cache.cpp: Added.
3172         (WebCore::Cache::match):
3173         (WebCore::Cache::matchAll):
3174         (WebCore::Cache::add):
3175         (WebCore::Cache::addAll):
3176         (WebCore::Cache::put):
3177         (WebCore::Cache::remove):
3178         (WebCore::Cache::keys):
3179         * Modules/cache/Cache.h: Added.
3180         (WebCore::Cache::create):
3181         (WebCore::Cache::Cache):
3182         * Modules/cache/Cache.idl: Added.
3183         * Modules/cache/CacheQueryOptions.h: Added.
3184         * Modules/cache/CacheQueryOptions.idl: Added.
3185         * Modules/cache/CacheStorage.cpp: Added.
3186         (WebCore::CacheStorage::match):
3187         (WebCore::CacheStorage::has):
3188         (WebCore::CacheStorage::open):
3189         (WebCore::CacheStorage::remove):
3190         (WebCore::CacheStorage::keys):
3191         * Modules/cache/CacheStorage.h: Added.
3192         (WebCore::CacheStorage::create):
3193         * Modules/cache/CacheStorage.idl: Added.
3194         * Modules/cache/DOMWindowCaches.cpp: Added.
3195         (WebCore::DOMWindowCaches::DOMWindowCaches):
3196         (WebCore::DOMWindowCaches::supplementName):
3197         (WebCore::DOMWindowCaches::from):
3198         (WebCore::DOMWindowCaches::caches):
3199         (WebCore::DOMWindowCaches::caches const):
3200         * Modules/cache/DOMWindowCaches.h: Added.
3201         * Modules/cache/DOMWindowCaches.idl: Added.
3202         * Modules/cache/WorkerGlobalScopeCaches.cpp: Added.
3203         (WebCore::WorkerGlobalScopeCaches::supplementName):
3204         (WebCore::WorkerGlobalScopeCaches::from):
3205         (WebCore::WorkerGlobalScopeCaches::caches):
3206         (WebCore::WorkerGlobalScopeCaches::caches const):
3207         * Modules/cache/WorkerGlobalScopeCaches.h: Added.
3208         * Modules/cache/WorkerGlobalScopeCaches.idl: Added.
3209         * WebCore.xcodeproj/project.pbxproj:
3210         * page/RuntimeEnabledFeatures.h:
3211         (WebCore::RuntimeEnabledFeatures::setCacheAPIEnabled):
3212         (WebCore::RuntimeEnabledFeatures::cacheAPIEnabled const):
3213
3214 2017-08-04  Brady Eidson  <beidson@apple.com>
3215
3216         Have navigator.serviceWorker() actually return a ServiceWorkerContainer object.
3217         https://bugs.webkit.org/show_bug.cgi?id=175215
3218
3219         Reviewed by Youenn Fablet.
3220
3221         * page/NavigatorBase.cpp:
3222         (WebCore::NavigatorBase::serviceWorker): Actually create and remember an object.
3223         * page/NavigatorBase.h:
3224
3225         * workers/ServiceWorkerContainer.cpp:
3226         (WebCore::rejectLater): Asynchronously reject the given promise with an error message.
3227         (WebCore::ServiceWorkerContainer::ServiceWorkerContainer):
3228         (WebCore::ServiceWorkerContainer::refEventTarget): Ref the underlying Navigator.
3229         (WebCore::ServiceWorkerContainer::derefEventTarget): Deref the underlying Navigator.
3230         (WebCore::ServiceWorkerContainer::ready): rejectLater the promise.
3231         (WebCore::ServiceWorkerContainer::addRegistration): Ditto.
3232         (WebCore::ServiceWorkerContainer::getRegistration): Ditto.
3233         (WebCore::ServiceWorkerContainer::getRegistrations): Ditto.
3234         * workers/ServiceWorkerContainer.h:
3235
3236 2017-08-04  Chris Dumez  <cdumez@apple.com>
3237
3238         [Beacon] Update sendBeacon to use the CachedResourceLoader
3239         https://bugs.webkit.org/show_bug.cgi?id=175192
3240         <rdar://problem/33725923>
3241
3242         Reviewed by Youenn Fablet.
3243
3244         Update sendBeacon to use the FetchRequest / CachedResourceLoader instead of
3245         the PingLoader. This gets us closer to the specification which is based on
3246         Fetch and reduces code duplication. This also fixes an issue where our
3247         Origin header was not properly set on Beacon resquests.
3248
3249         In a follow-up, we will implement in CachedResourceLoader Fetch's quota for
3250         inflight keepalive requests which is needed to fully support sendBeacon().
3251
3252         * Modules/beacon/NavigatorBeacon.cpp:
3253         (WebCore::NavigatorBeacon::sendBeacon):
3254         * Modules/beacon/NavigatorBeacon.h:
3255         * loader/LinkLoader.cpp:
3256         (WebCore::createLinkPreloadResourceClient):
3257         * loader/PingLoader.cpp:
3258         * loader/PingLoader.h:
3259         * loader/ResourceLoadInfo.cpp:
3260         (WebCore::toResourceType):
3261         * loader/SubresourceLoader.cpp:
3262         (WebCore::logResourceLoaded):
3263         * loader/cache/CachedResource.cpp:
3264         (WebCore::CachedResource::defaultPriorityForResourceType):
3265         (WebCore::CachedResource::load):
3266         * loader/cache/CachedResource.h:
3267         * loader/cache/CachedResourceLoader.cpp:
3268         (WebCore::createResource):
3269         (WebCore::CachedResourceLoader::requestBeaconResource):
3270         (WebCore::contentTypeFromResourceType):
3271         (WebCore::CachedResourceLoader::checkInsecureContent const):
3272         (WebCore::CachedResourceLoader::allowedByContentSecurityPolicy const):
3273         (WebCore::isResourceSuitableForDirectReuse):
3274         * loader/cache/CachedResourceLoader.h:
3275
3276 2017-08-04  John Wilander  <wilander@apple.com>
3277
3278         Resource Load Statistics: Report user interaction immediately, but only when needed
3279         https://bugs.webkit.org/show_bug.cgi?id=175090
3280         <rdar://problem/33685546>
3281
3282         Reviewed by Chris Dumez.
3283
3284         Test: http/tests/loading/resourceLoadStatistics/user-interaction-only-reported-once-within-short-period-of-time.html
3285
3286         * loader/ResourceLoadObserver.cpp:
3287         (WebCore::ResourceLoadObserver::ResourceLoadObserver):
3288         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
3289             Now tells the UI process immediately but also records that it has
3290             done so to avoid doing it when not needed.
3291         (WebCore::ResourceLoadObserver::scheduleNotificationIfNeeded):
3292             Conditional throttling gone, now always throttles.
3293         (WebCore::ResourceLoadObserver::notifyObserver):
3294             Renamed from ResourceLoadObserver::notificationTimerFired().
3295         (WebCore::ResourceLoadObserver::clearState):
3296             New function to allow the test runner to reset the web process'
3297             statistics state now that we keep track of whether or not we've
3298             reported user interaction to the UI process.
3299         (WebCore::ResourceLoadObserver::setShouldThrottleObserverNotifications): Deleted.
3300         (WebCore::ResourceLoadObserver::notificationTimerFired): Deleted.
3301         * loader/ResourceLoadObserver.h:
3302         (): Deleted.
3303         * testing/Internals.cpp:
3304         (WebCore::Internals::resetToConsistentState):
3305         (WebCore::Internals::setResourceLoadStatisticsShouldThrottleObserverNotifications): Deleted.
3306             No longer needed since user interaction is always communicated
3307             immediately.
3308         * testing/Internals.h:
3309         * testing/Internals.idl:
3310
3311 2017-08-04  Matt Baker  <mattbaker@apple.com>
3312
3313         Web Inspector: capture async stack trace when workers/main context posts a message
3314         https://bugs.webkit.org/show_bug.cgi?id=167084
3315         <rdar://problem/30033673>
3316
3317         Reviewed by Brian Burg.
3318
3319         Add instrumentation to DOMWindow to support showing asynchronous
3320         stack traces when the debugger pauses in a MessageEvent handler.
3321
3322         Test: inspector/debugger/async-stack-trace.html
3323
3324         * inspector/InspectorInstrumentation.cpp:
3325         (WebCore::InspectorInstrumentation::didPostMessageImpl):
3326         (WebCore::InspectorInstrumentation::didFailPostMessageImpl):
3327         (WebCore::InspectorInstrumentation::willDispatchPostMessageImpl):
3328         (WebCore::InspectorInstrumentation::didDispatchPostMessageImpl):
3329
3330         * inspector/InspectorInstrumentation.h:
3331         (WebCore::InspectorInstrumentation::didPostMessage):
3332         (WebCore::InspectorInstrumentation::didFailPostMessage):
3333         (WebCore::InspectorInstrumentation::willDispatchPostMessage):
3334         (WebCore::InspectorInstrumentation::didDispatchPostMessage):
3335
3336         * inspector/PageDebuggerAgent.cpp:
3337         (WebCore::PageDebuggerAgent::didClearAsyncStackTraceData):
3338         (WebCore::PageDebuggerAgent::didPostMessage):
3339         (WebCore::PageDebuggerAgent::didFailPostMessage):
3340         (WebCore::PageDebuggerAgent::willDispatchPostMessage):
3341         (WebCore::PageDebuggerAgent::didDispatchPostMessage):
3342         * inspector/PageDebuggerAgent.h:
3343
3344         * page/DOMWindow.cpp:
3345         (WebCore::DOMWindow::postMessage):
3346         (WebCore::DOMWindow::postMessageTimerFired):
3347
3348 2017-08-04  Devin Rousso  <drousso@apple.com>
3349
3350         Web Inspector: add source view for WebGL shader programs
3351         https://bugs.webkit.org/show_bug.cgi?id=138593
3352         <rdar://problem/18936194>
3353
3354         Reviewed by Matt Baker.
3355
3356         Test: inspector/canvas/requestShaderSource.html
3357
3358         * inspector/InspectorCanvasAgent.h:
3359         * inspector/InspectorCanvasAgent.cpp:
3360         (WebCore::InspectorCanvasAgent::requestShaderSource):
3361
3362         * inspector/InspectorShaderProgram.h:
3363         * inspector/InspectorShaderProgram.cpp:
3364         (WebCore::InspectorShaderProgram::shaderForType):
3365
3366 2017-08-04  Matt Lewis  <jlewis3@apple.com>
3367
3368         Unreviewed, rolling out r220288.
3369
3370         This broke multiple builds.
3371
3372         Reverted changeset:
3373
3374         "Use MPAVRoutingController instead of deprecated versions."
3375         https://bugs.webkit.org/show_bug.cgi?id=175063
3376         http://trac.webkit.org/changeset/220288
3377
3378 2017-08-03  Filip Pizlo  <fpizlo@apple.com>
3379
3380         The allocator used to allocate memory for MarkedBlocks and LargeAllocations should not be the Subspace itself
3381         https://bugs.webkit.org/show_bug.cgi?id=175141
3382
3383         Reviewed by Mark Lam.
3384
3385         No new tests because no new behavior.
3386         
3387         Just adapting to an API change.
3388
3389         * ForwardingHeaders/heap/FastMallocAlignedMemoryAllocator.h: Added.
3390         * bindings/js/WebCoreJSClientData.cpp:
3391         (WebCore::JSVMClientData::JSVMClientData):
3392
3393 2017-08-04  Chris Dumez  <cdumez@apple.com>
3394
3395         Match newly-clarified spec on textarea defaultValue/value/child text content
3396         https://bugs.webkit.org/show_bug.cgi?id=173878
3397
3398         Reviewed by Darin Adler.
3399
3400         Update HTMLTextArea.defaultValue to match align with other browsers and match the
3401         latest HTML specification:
3402         - https://html.spec.whatwg.org/#dom-textarea-defaultvalue
3403
3404         The defaultValue getter should return the child text content:
3405         - https://dom.spec.whatwg.org/#concept-child-text-content
3406         Our code was traversing all Text descendants, not just the children.
3407
3408         The defaultValue setter should act as the setter of the Element's textContent
3409         IDL attribute. Previously, we had a custom logic that was only removing the
3410         text children.
3411
3412         Test: imported/w3c/web-platform-tests/html/semantics/forms/the-textarea-element/value-defaultValue-textContent.html
3413
3414         * dom/ScriptElement.cpp:
3415         (WebCore::ScriptElement::scriptContent const):
3416         * dom/TextNodeTraversal.cpp:
3417         (WebCore::TextNodeTraversal::childTextContent):
3418         * dom/TextNodeTraversal.h:
3419         * html/HTMLTextAreaElement.cpp:
3420         (WebCore::HTMLTextAreaElement::defaultValue const):
3421         (WebCore::HTMLTextAreaElement::setDefaultValue):
3422         * html/HTMLTitleElement.cpp:
3423         (WebCore::HTMLTitleElement::text const):
3424
3425 2017-08-04  Said Abou-Hallawa  <sabouhallawa@apple.com>
3426
3427         RenderImageResourceStyleImage::image() should return the nullImage() if the image is not available
3428         https://bugs.webkit.org/show_bug.cgi?id=174874
3429         <rdar://problem/33530130>
3430
3431         Reviewed by Simon Fraser.
3432
3433         If an <img> element has a non-CachedImage content data, e.g. -webkit-named-image,
3434         RenderImageResourceStyleImage will be created and  attached to the RenderImage.
3435         RenderImageResourceStyleImage::m_cachedImage will be set to null at the 
3436         beginning because the m_styleImage->isCachedImage() is false in this case.
3437         When ImageLoader finishes loading the url of the src attribute,
3438         RenderImageResource::setCachedImage() will be called to set m_cachedImage.
3439
3440         A crash will happen when the RenderImage is destroyed. Destroying the 
3441         RenderImage calls RenderImageResourceStyleImage::shutdown() which checks
3442         m_cachedImage and finds it not null, so it calls RenderImageResourceStyleImage::image()
3443         which ends up calling CSSNamedImageValue::image() which returns a null pointer
3444         because the size is empty. RenderImageResourceStyleImage::shutdown() calls
3445         image()->stopAnimation() without checking the return value of image().
3446