Deny third-party cookie creation for prevalent resources without interaction
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-09-06  Brent Fulgham  <bfulgham@apple.com>
2
3         Deny third-party cookie creation for prevalent resources without interaction
4         https://bugs.webkit.org/show_bug.cgi?id=175232
5         <rdar://problem/33709386>
6
7         Reviewed by Alex Christensen.
8
9         Prior to Intelligent Tracking Prevention, WebKit would deny the ability to create a third party cookie if the user's
10         settings prohibited it. Due to the internal mechanics of cookie partitioning, we now accept the third party cookie,
11         but destroy it at some arbitrary moment which is difficult for websites to work with.
12         
13         This patch revises WebKit so that attempts to set third party cookies without user interaction fails immediately,
14         which is what sites are expecting from Safari.
15
16         Tests: http/tests/loading/resourceLoadStatistics/third-party-cookie-with-and-without-user-interaction.html
17
18         * platform/network/NetworkStorageSession.h:
19         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
20         (WebCore::NetworkStorageSession::shouldPartitionCookies const): Revise for new naming.
21         (WebCore::NetworkStorageSession::shouldAllowThirdPartyCookies const): Allow third party cookies when the
22         user interaction property applies.
23         (WebCore::NetworkStorageSession::shouldBlockCookies const): Deny cookies for origins that are not allowed by
24         user interaction, and that are not being partitioned.
25         (WebCore::NetworkStorageSession::setPrevalentDomainsWithAndWithoutInteraction): Revise for new naming, and
26         to track prevalent origins with and without user interaction.
27         (WebCore::NetworkStorageSession::setShouldPartitionCookiesForHosts): Renamed to setPrevalentDomainsWithAndWithoutInteraction.
28         (WebCore::NetworkStorageSession::removePrevalentDomains): New helper function for testing.
29
30 2017-09-06  Tomas Popela  <tpopela@redhat.com>
31
32         Missing break in URLParser
33         https://bugs.webkit.org/show_bug.cgi?id=176357
34
35         Reviewed by Darin Adler.
36
37         Add a missing break so the currently set state is not overwritten
38         after the block. Found by Coverity scan.
39
40         * platform/URLParser.cpp:
41         (WebCore::URLParser::parse):
42
43 2017-09-06  Dominik Röttsches  <dominik.rottsches@intel.com>
44
45         [GTK] Bump freetype version to 2.8.0
46         https://bugs.webkit.org/show_bug.cgi?id=176351
47
48         Reviewed by Carlos Alberto Lopez Perez.
49
50         Retrieving line spacing info without metrics hinting - FreeType's metric hinting
51         uses rounding which results in the sum of ascent and descent being larger
52         than the line height. To work around this without globally disabling font metrics
53         hinting, I am temporarily creating a new cairo scaled font with metrics hinting
54         off and retrieving the height values from this one.
55
56         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
57         (WebCore::scaledFontWithoutMetricsHinting): New function to clone the existing font, only with metrics hinting
58         disabled.
59         (WebCore::Font::platformInit): Get height info from non-metrics hinted font, disable rounding for linespacing.
60
61 2017-09-06  Frédéric Wang  <fwang@igalia.com>
62
63         Introduce ScrollingTreeScrollingNodeDelegateIOS to share code between overflow and frame scrolling
64         https://bugs.webkit.org/show_bug.cgi?id=174097
65
66         Reviewed by Darin Adler.
67
68         No new tests, behavior unchanged.
69
70         * WebCore.xcodeproj/project.pbxproj: Add ScrollingTreeScrollingNodeDelegate.
71         * page/scrolling/ScrollingTreeScrollingNode.h: Make ScrollingTreeScrollingNodeDelegate a
72         friend so that it can access private members.
73         * page/scrolling/ScrollingTreeScrollingNodeDelegate.cpp: Added. New delegate class for a
74         scrolling node, which is used by the UI process.
75         (WebCore::ScrollingTreeScrollingNodeDelegate::ScrollingTreeScrollingNodeDelegate):
76         Constructor, taking the scrolling node as a parameter.
77         (WebCore::ScrollingTreeScrollingNodeDelegate::~ScrollingTreeScrollingNodeDelegate):
78         (WebCore::ScrollingTreeScrollingNodeDelegate::scrollingTree const): Expose the scrolling
79         tree containing the scrolling node.
80         (WebCore::ScrollingTreeScrollingNodeDelegate::lastCommittedScrollPosition const): Expose
81         the last committed scroll position of the scrolling node.
82         * page/scrolling/ScrollingTreeScrollingNodeDelegate.h: Added.
83         (WebCore::ScrollingTreeScrollingNodeDelegate::scrollingNode): Expose the scrolling node.
84         (WebCore::ScrollingTreeScrollingNodeDelegate::scrollingNode const): Ditto.
85
86 2017-09-06  Manuel Rego Casasnovas  <rego@igalia.com>
87
88         [css-grid] grid shorthand should not reset the gutter properties
89         https://bugs.webkit.org/show_bug.cgi?id=176375
90
91         Reviewed by Sergio Villar Senin.
92
93         The CSS WG has resolved that the "grid" shorthand shouldn't reset
94         the gutter properties anymore:
95         https://github.com/w3c/csswg-drafts/issues/1036
96
97         This was originally implemented in r195529, so this is somehow
98         a revert of that change.
99
100         Test: imported/w3c/web-platform-tests/css/css-grid-1/grid-definition/grid-shorthand-001.html
101
102         * css/CSSProperties.json:
103         * css/parser/CSSPropertyParser.cpp:
104         (WebCore::CSSPropertyParser::consumeGridShorthand):
105
106 2017-09-06  Zan Dobersek  <zdobersek@igalia.com>
107
108         [WebGL2] Implement getActiveUniforms()
109         https://bugs.webkit.org/show_bug.cgi?id=175203
110
111         Reviewed by Darin Adler.
112
113         Align getActiveUniforms() WebIDL signature with the spec -- making it
114         return a WebGLAny object, making the program parameter non-nullable,
115         and making the uniformIndices parameter a sequence on GLuint values.
116
117         The getActiveUniforms() implementation in WebGL2RenderingContext
118         validates the passed-in program and parameter name and then calls the
119         GraphicsContext3D::getActiveUniforms() method, retrieving an array of
120         integers that represent values of the requested parameter name for
121         each uniform whose index was passed through uniformIndices.
122
123         Test: fast/canvas/webgl/webgl2-getActiveUniforms.html
124
125         * bindings/js/JSDOMConvertWebGL.cpp:
126         (WebCore::convertToJSValue):
127         * html/canvas/WebGL2RenderingContext.cpp:
128         (WebCore::WebGL2RenderingContext::getActiveUniforms):
129         * html/canvas/WebGL2RenderingContext.h:
130         * html/canvas/WebGL2RenderingContext.idl:
131         * html/canvas/WebGLAny.h:
132         * platform/graphics/GraphicsContext3D.h:
133         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
134         (WebCore::GraphicsContext3D::getActiveUniforms):
135
136 2017-09-05  Zan Dobersek  <zdobersek@igalia.com>
137
138         [WebCrypto] Downcast parameters and keys at the platform operation callsites
139         https://bugs.webkit.org/show_bug.cgi?id=176392
140
141         Reviewed by Sam Weinig.
142
143         Downcast to algorithm-specific parameter and key types in the shared
144         code that then invokes platform-specific operation implementations.
145         This reduces the duplicated downcasts across different implementations
146         that don't differ at all in this behavior.
147
148         Covered by existing tests.
149
150         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
151         (WebCore::CryptoAlgorithmAES_CBC::encrypt):
152         (WebCore::CryptoAlgorithmAES_CBC::decrypt):
153         * crypto/algorithms/CryptoAlgorithmAES_CBC.h:
154         * crypto/algorithms/CryptoAlgorithmAES_CFB.cpp:
155         (WebCore::CryptoAlgorithmAES_CFB::encrypt):
156         (WebCore::CryptoAlgorithmAES_CFB::decrypt):
157         * crypto/algorithms/CryptoAlgorithmAES_CFB.h:
158         * crypto/algorithms/CryptoAlgorithmAES_CTR.cpp:
159         (WebCore::CryptoAlgorithmAES_CTR::encrypt):
160         (WebCore::CryptoAlgorithmAES_CTR::decrypt):
161         * crypto/algorithms/CryptoAlgorithmAES_CTR.h:
162         * crypto/algorithms/CryptoAlgorithmAES_GCM.cpp:
163         (WebCore::CryptoAlgorithmAES_GCM::encrypt):
164         (WebCore::CryptoAlgorithmAES_GCM::decrypt):
165         * crypto/algorithms/CryptoAlgorithmAES_GCM.h:
166         * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
167         (WebCore::CryptoAlgorithmAES_KW::wrapKey):
168         (WebCore::CryptoAlgorithmAES_KW::unwrapKey):
169         * crypto/algorithms/CryptoAlgorithmAES_KW.h:
170         * crypto/algorithms/CryptoAlgorithmECDH.cpp:
171         (WebCore::CryptoAlgorithmECDH::deriveBits):
172         * crypto/algorithms/CryptoAlgorithmECDH.h:
173         * crypto/algorithms/CryptoAlgorithmECDSA.cpp:
174         (WebCore::CryptoAlgorithmECDSA::sign):
175         (WebCore::CryptoAlgorithmECDSA::verify):
176         * crypto/algorithms/CryptoAlgorithmECDSA.h:
177         * crypto/algorithms/CryptoAlgorithmHKDF.cpp:
178         (WebCore::CryptoAlgorithmHKDF::deriveBits):
179         * crypto/algorithms/CryptoAlgorithmHKDF.h:
180         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
181         (WebCore::CryptoAlgorithmHMAC::sign):
182         (WebCore::CryptoAlgorithmHMAC::verify):
183         * crypto/algorithms/CryptoAlgorithmHMAC.h:
184         * crypto/algorithms/CryptoAlgorithmPBKDF2.cpp:
185         (WebCore::CryptoAlgorithmPBKDF2::deriveBits):
186         * crypto/algorithms/CryptoAlgorithmPBKDF2.h:
187         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
188         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::encrypt):
189         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::decrypt):
190         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
191         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
192         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::sign):
193         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::verify):
194         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
195         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
196         (WebCore::CryptoAlgorithmRSA_OAEP::encrypt):
197         (WebCore::CryptoAlgorithmRSA_OAEP::decrypt):
198         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
199         * crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:
200         (WebCore::CryptoAlgorithmRSA_PSS::sign):
201         (WebCore::CryptoAlgorithmRSA_PSS::verify):
202         * crypto/algorithms/CryptoAlgorithmRSA_PSS.h:
203         * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp:
204         (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
205         (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
206         * crypto/gcrypt/CryptoAlgorithmAES_CFBGCrypt.cpp:
207         (WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
208         (WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
209         * crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp:
210         (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
211         (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
212         * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp:
213         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
214         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
215         * crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp:
216         (WebCore::CryptoAlgorithmAES_KW::platformWrapKey):
217         (WebCore::CryptoAlgorithmAES_KW::platformUnwrapKey):
218         * crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp:
219         (WebCore::CryptoAlgorithmECDH::platformDeriveBits):
220         * crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp:
221         (WebCore::CryptoAlgorithmECDSA::platformSign):
222         (WebCore::CryptoAlgorithmECDSA::platformVerify):
223         * crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp:
224         (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
225         * crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:
226         (WebCore::CryptoAlgorithmHMAC::platformSign):
227         (WebCore::CryptoAlgorithmHMAC::platformVerify):
228         * crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp:
229         (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
230         * crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp:
231         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):
232         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt):
233         * crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp:
234         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformSign):
235         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformVerify):
236         * crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp:
237         (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
238         (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
239         * crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp:
240         (WebCore::CryptoAlgorithmRSA_PSS::platformSign):
241         (WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
242         * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
243         (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
244         (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
245         * crypto/mac/CryptoAlgorithmAES_CFBMac.cpp:
246         (WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
247         (WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
248         * crypto/mac/CryptoAlgorithmAES_CTRMac.cpp:
249         (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
250         (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
251         * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
252         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
253         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
254         * crypto/mac/CryptoAlgorithmAES_KWMac.cpp:
255         (WebCore::CryptoAlgorithmAES_KW::platformWrapKey):
256         (WebCore::CryptoAlgorithmAES_KW::platformUnwrapKey):
257         * crypto/mac/CryptoAlgorithmECDHMac.cpp:
258         (WebCore::CryptoAlgorithmECDH::platformDeriveBits):
259         * crypto/mac/CryptoAlgorithmECDSAMac.cpp:
260         (WebCore::CryptoAlgorithmECDSA::platformSign):
261         (WebCore::CryptoAlgorithmECDSA::platformVerify):
262         * crypto/mac/CryptoAlgorithmHKDFMac.cpp:
263         (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
264         * crypto/mac/CryptoAlgorithmHMACMac.cpp:
265         (WebCore::CryptoAlgorithmHMAC::platformSign):
266         (WebCore::CryptoAlgorithmHMAC::platformVerify):
267         * crypto/mac/CryptoAlgorithmPBKDF2Mac.cpp:
268         (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
269         * crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp:
270         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):
271         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt):
272         * crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
273         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformSign):
274         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformVerify):
275         * crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
276         (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
277         (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
278         * crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:
279         (WebCore::CryptoAlgorithmRSA_PSS::platformSign):
280         (WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
281
282 2017-09-05  Darin Adler  <darin@apple.com>
283
284         Fix a few minor problems found while working toward removing unneeded calls to updateStyle
285         https://bugs.webkit.org/show_bug.cgi?id=176279
286
287         Reviewed by Antti Koivisto.
288
289         * dom/Document.cpp:
290         (WebCore::Document::updateTitleElement): Fix the algorithm so that an SVG title won't
291         ever become the title when the document element is not an SVG element. We had this wrong
292         before but we were passing the test because SVGTitleElement::insertedInto had a bug that
293         hid the problem.
294         (WebCore::Document::titleElementAdded): Pass a reference instead of a pointer.
295         (WebCore::Document::titleElementRemoved): Pass a reference instead of nullptr since we
296         want to know which element is being removed.
297
298         * dom/Document.h: Update the argument name and type for updateTitleElement.
299
300         * html/HTMLTitleElement.cpp:
301         (WebCore::HTMLTitleElement::insertedInto): Call titleElementAdded unconditionally.
302         The checks to see if the title element is connected to the document and not in the
303         shadow tree are now handled by the Document class.
304         (WebCore::HTMLTitleElement::removedFrom): Same for titleElementRemoved.
305
306         * platform/mock/MockRealtimeVideoSource.cpp:
307         (WebCore::MockRealtimeVideoSource::applySize): Removed incorrect caching of FontCascade
308         objects; these need to be created each time we draw.
309         (WebCore::MockRealtimeVideoSource::drawText): Create all the fonts here. Since this is
310         a mock for testing, there is no real performance concern with doing this.
311         * platform/mock/MockRealtimeVideoSource.h: Removed the FontCascade data members.
312
313         * rendering/RenderTreeAsText.cpp:
314         (WebCore::updateLayoutIgnoringPendingStylesheetsIncludingSubframes): Added. Used below
315         to update layout more thoroughly.
316         (WebCore::externalRepresentation): Update layout of all descendant frames, not just
317         the top level frame.
318
319         * svg/SVGTitleElement.cpp:
320         (WebCore::SVGTitleElement::insertedInto): Removed bogus firstChild check, bogus isSVGDocument
321         check, and unneeded isConnected check and call titleElementAdded unconditionally. The checks
322         are now handled by the Document class.
323         (WebCore::SVGTitleElement::removedFrom): Same for titleElementRemoved.
324
325         * testing/Internals.cpp:
326         (WebCore::Internals::layerTreeAsText const): Added missing updateLayoutIgnorePendingStylesheets,
327         since dumping the layer tree without first doing a layout will yield stale results.
328         (WebCore::Internals::layerIDForElement): Added missing updateLayoutIgnorePendingStylesheets,
329         since using a renderer to check if a layer exists without first doing a layout will yield stale results.
330         (WebCore::Internals::setElementUsesDisplayListDrawing): Ditto.
331         (WebCore::Internals::setElementTracksDisplayListReplay): Ditto.
332         (WebCore::Internals::displayListForElement): Ditto.
333         (WebCore::Internals::replayDisplayListForElement): Ditto.
334         (WebCore::Internals::isSelectPopupVisible): Added missing updateLayoutIgnorePendingStylesheets,
335         since working with the RenderMenuList without first doing a layout will yield stale results.
336         Also removed unneeded strict handling of null renderer, instead just returning false.
337         (WebCore::Internals::isPluginUnavailabilityIndicatorObscured): Removed unnneeded check of
338         renderer class, since the HTMLPlugInElement::isReplacementObscured already handles that correctly.
339         (WebCore::Internals::pageOverlayLayerTreeAsText const): Use updateLayoutIgnorePendingStylesheets
340         instead of the normal updateLayout for consistency with the behavior of the other functions in this
341         file, and because we need a real answer here.
342         (WebCore::Internals::scrollSnapOffsets): Ditto. Also rearranged the code so the renderer check is
343         done after updating the renderer tree.
344
345 2017-09-05  Ryan Haddad  <ryanhaddad@apple.com>
346
347         Unreviewed, rolling out r221495.
348
349         This change introduced  assertion failures on El Capitan Debug
350         WK2.
351
352         Reverted changeset:
353
354         "Move ServiceWorkerJob from FetchLoader to ThreadableLoader."
355         https://bugs.webkit.org/show_bug.cgi?id=176231
356         http://trac.webkit.org/changeset/221495
357
358 2017-09-05  Chris Dumez  <cdumez@apple.com>
359
360         Add support for input.webkitEntries
361         https://bugs.webkit.org/show_bug.cgi?id=176257
362         <rdar://problem/34218671>
363
364         Reviewed by Andreas Kling.
365
366         Add support for input.webkitEntries as per:
367         - https://wicg.github.io/entries-api/#html-forms
368
369         Our behavior matches Chrome and Firefox, rather than the specification. This means
370         that webkitEntries is only populated if the webkitdirectory flag is unset.
371
372         Tests: fast/forms/file/entries-api/drag-folder-webkitEntries.html
373                fast/forms/file/entries-api/webkitdirectory-drag-folder-webkitEntries.html
374
375         * CMakeLists.txt:
376         * DerivedSources.make:
377         * Modules/entriesapi/HTMLInputElementEntriesAPI.cpp: Added.
378         (WebCore::HTMLInputElementEntriesAPI::webkitEntries):
379         * Modules/entriesapi/HTMLInputElementEntriesAPI.h: Added.
380         * Modules/entriesapi/HTMLInputElementEntriesAPI.idl: Added.
381         * WebCore.xcodeproj/project.pbxproj:
382         * bindings/scripts/generate-bindings.pl:
383         * bindings/scripts/test/JS/JSTestInterface.cpp:
384         (WebCore::jsTestInterfaceReflectAttributeGetter):
385         (WebCore::jsTestInterfaceReflectAttribute):
386         (WebCore::setJSTestInterfaceReflectAttributeSetter):
387         (WebCore::setJSTestInterfaceReflectAttribute):
388         * bindings/scripts/test/TestSupplemental.idl:
389         * html/HTMLInputElement.idl:
390
391 2017-09-05  Chris Dumez  <cdumez@apple.com>
392
393         FileSystemEntry API should ignore hidden files
394         https://bugs.webkit.org/show_bug.cgi?id=176292
395         <rdar://problem/34257666>
396
397         Reviewed by Andreas Kling.
398
399         FileSystemEntry API should ignore hidden files as the user likely does not mean
400         to expose those when drag'n dropping a folder.
401
402         Test: editing/pasteboard/enties-api/datatransfer-items-drop-hidden-file.html
403
404         * Modules/entriesapi/DOMFileSystem.cpp:
405         (WebCore::listDirectoryWithMetadata):
406         (WebCore::validatePathIsExpectedType):
407         (WebCore::fileType):
408         (WebCore::DOMFileSystem::getEntry):
409
410 2017-09-05  Myles C. Maxfield  <mmaxfield@apple.com>
411
412         Update font selection algorithm to match latest CSS spec
413         https://bugs.webkit.org/show_bug.cgi?id=175236
414
415         Reviewed by Darin Adler.
416
417         The CSS WG tweaked the generalization of the font selection
418         algorithm between levels 3 and 4. In particular, the behavior
419         of weights between 400 and 500 works a little differently.
420
421         https://github.com/w3c/csswg-drafts/commit/f6973a21847f1c200ed38bff05dc543cebe1c827
422
423         Test: fast/text/variations/font-selection-font-weight.html
424
425         * platform/graphics/FontSelectionAlgorithm.cpp:
426         (WebCore::FontSelectionAlgorithm::weightDistance const):
427         * platform/graphics/FontSelectionAlgorithm.h:
428         (WebCore::lowerWeightSearchThreshold):
429         (WebCore::upperWeightSearchThreshold):
430         (WebCore::weightSearchThreshold): Deleted.
431
432 2017-09-05  Per Arne Vollan  <pvollan@apple.com>
433
434         [Win] Compile errors in pathByAppendingComponents.
435         https://bugs.webkit.org/show_bug.cgi?id=176387
436
437         Reviewed by Brent Fulgham.
438
439         The pathByAppendingComponents function has changed signature.
440
441         * platform/win/FileSystemWin.cpp:
442         (WebCore::pathByAppendingComponents):
443
444 2017-09-05  Simon Fraser  <simon.fraser@apple.com>
445
446         Fix capitalization of scheduleinvalidateStyleAndLayerComposition
447         https://bugs.webkit.org/show_bug.cgi?id=176266
448
449         Reviewed by Antti Koivisto.
450
451         * html/HTMLFrameOwnerElement.cpp:
452         (WebCore::HTMLFrameOwnerElement::scheduleInvalidateStyleAndLayerComposition):
453         (WebCore::HTMLFrameOwnerElement::scheduleinvalidateStyleAndLayerComposition): Deleted.
454         * html/HTMLFrameOwnerElement.h:
455         * rendering/RenderLayerCompositor.cpp:
456         (WebCore::RenderLayerCompositor::attachRootLayer):
457         (WebCore::RenderLayerCompositor::detachRootLayer):
458         (WebCore::RenderLayerCompositor::notifyIFramesOfCompositingChange):
459
460 2017-09-05  Matt Lewis  <jlewis3@apple.com>
461
462         Unreviewed, rolling out r221603.
463
464         This caused accessibility/mac/select-element-selection-with-
465         optgroups.html to consistently timeout on macOS
466
467         Reverted changeset:
468
469         "Fix a few minor problems found while working toward removing
470         unneeded calls to updateStyle"
471         https://bugs.webkit.org/show_bug.cgi?id=176279
472         http://trac.webkit.org/changeset/221603
473
474 2017-09-05  Youenn Fablet  <youenn@apple.com>
475
476         Allow retrieving Cache Storage records for a given URL only
477         https://bugs.webkit.org/show_bug.cgi?id=176202
478
479         Reviewed by Alex Christensen.
480
481         No observable change of behavior.
482
483         Adding a URL parameter to CacheStorageConnection::retrieveRecords.
484         If given URL is null, all records will be retrieved, which is useful for the keys method.
485         Other operations only need records that share the same URL (modulo query string and frag id).
486
487         * Modules/cache/Cache.cpp:
488         (WebCore::Cache::matchAll):
489         (WebCore::Cache::keys):
490         (WebCore::Cache::retrieveRecords):
491         (WebCore::Cache::queryCache):
492         * Modules/cache/Cache.h:
493         * Modules/cache/CacheStorageConnection.cpp:
494         (WebCore::CacheStorageConnection::retrieveRecords):
495         * Modules/cache/CacheStorageConnection.h:
496         (WebCore::CacheStorageConnection::doRetrieveRecords):
497         * Modules/cache/WorkerCacheStorageConnection.cpp:
498         (WebCore::WorkerCacheStorageConnection::doRetrieveRecords):
499         * Modules/cache/WorkerCacheStorageConnection.h:
500         * platform/URL.h:
501
502 2017-09-05  Tim Horton  <timothy_horton@apple.com>
503
504         Remove some unused bits of code and resources
505         https://bugs.webkit.org/show_bug.cgi?id=176275
506
507         Reviewed by Dan Bernstein.
508
509         No new tests, just removing things.
510
511         * Resources/textAreaResizeCorner.tiff: Removed.
512         * Resources/missingImage.tiff: Removed.
513         These files have PNG versions that include more resolutions.
514
515         * Resources/hScrollControl_left.png: Removed.
516         * Resources/hScrollControl_middle.png: Removed.
517         * Resources/hScrollControl_right.png: Removed.
518         * Resources/vScrollControl_bottom.png: Removed.
519         * Resources/vScrollControl_middle.png: Removed.
520         * Resources/vScrollControl_top.png: Removed.
521         * Resources/decrementArrow.tiff: Removed.
522         * Resources/incrementArrow.tiff: Removed.
523         * Resources/markedLeft.png: Removed.
524         * Resources/markedMiddle.png: Removed.
525         * Resources/markedRight.png: Removed.
526         These were added in r161638 as part of the iOS upstreaming, but were
527         unused even then.
528
529         * Resources/inputSpeech.tiff: Removed.
530         The feature this image was for was removed in r172259; the PNG version
531         of this image was removed in r172384.
532
533         * WebCore.xcodeproj/project.pbxproj:
534         * platform/ios/FileSystemIOS.h: Removed.
535         * platform/ios/FileSystemIOS.mm: Removed.
536         Remove FileSystemIOS; one function is unused, the other is not at all
537         iOS-specific and can be folded into FileSystemCocoa.
538
539         * platform/FileSystem.h:
540         * platform/cocoa/FileSystemCocoa.mm:
541         (WebCore::createTemporaryDirectory):
542         Move this in from FileSystemIOS.
543
544         * platform/PlatformEvent.cpp: Removed.
545         Remove this unused file.
546         
547         * platform/ios/QuickLook.mm:
548         * platform/ios/WebItemProviderPasteboard.mm:
549         Include FileSystem instead of FileSystemIOS.
550
551 2017-09-05  Frederic Wang  <fwang@igalia.com>
552
553         Use TilesBacking for iframes when async frame scrolling is enabled
554         https://bugs.webkit.org/show_bug.cgi?id=173644
555
556         Reviewed by Simon Fraser.
557
558         This patch adds creation of TilesBacking for non-main frames when async frame scrolling is
559         enabled. RenderLayerBacking::m_isMainFrameLayerWithTiledBacking is also renamed to reflect
560         that tiled backing is not exclusive to the main frame. More adjustments might be needed for
561         non-main frames and will be handled in follow-up commits.
562
563         Test: compositing/tiling/tiled-drawing-async-frame-scrolling.html
564
565         * rendering/RenderLayerBacking.cpp: Rename m_isMainFrameLayerWithTiledBacking
566         * rendering/RenderLayerBacking.h: Rename isMainFrameLayerWithTiledBacking and
567         m_isMainFrameLayerWithTiledBacking.
568         * rendering/RenderLayerCompositor.cpp: Use isFrameLayerWithTiledBacking
569
570 2017-09-05  Zan Dobersek  <zdobersek@igalia.com>
571
572         HTMLMediaElement: attach any existing EME CDMInstance in mediaEngineWasUpdated()
573         https://bugs.webkit.org/show_bug.cgi?id=176354
574
575         Reviewed by Xabier Rodriguez-Calvar.
576
577         It's common for MediaKeys to be set on an HTMLMediaElement object before
578         any resource is loaded for that element, meaning no underlying MediaPlayer
579         exists at that point. In order to not stall the pipeline when encrypted
580         content is finally loaded, the CDMInstance object of the current MediaKeys
581         set on this element should be attached in mediaEngineWasUpdated() that's
582         called whenever the underlying MediaPlayerPrivate object is replaced.
583
584         * html/HTMLMediaElement.cpp:
585         (WebCore::HTMLMediaElement::mediaEngineWasUpdated):
586
587 2017-09-05  Zan Dobersek  <zdobersek@igalia.com>
588
589         [EME] HTMLMediaElement: setMediaKeys() should attach CDMInstance from the arriving MediaKeys
590         https://bugs.webkit.org/show_bug.cgi?id=176352
591
592         Reviewed by Xabier Rodriguez-Calvar.
593
594         In HTMLMediaElement::setMediaKeys(), use the incoming MediaKeys object
595         to retrieve the CDMInstance that is then attached to the current
596         MediaPlayer, if any.
597
598         Covered by existing W3C tests that focus on multi-key use cases.
599
600         * html/HTMLMediaElement.cpp:
601         (WebCore::HTMLMediaElement::setMediaKeys):
602
603 2017-09-05  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
604
605         [Win] Fix the wincairo build after r221558 and r221583
606         https://bugs.webkit.org/show_bug.cgi?id=176353
607
608         Reviewed by Yusuke Suzuki.
609
610         * platform/win/FileSystemWin.cpp:
611         (WebCore::isSymbolicLink): Fix a "missing type specifier" error
612         (WebCore::findDataToFileMetadata): Fix a narrowing convertion error
613
614 2017-09-04  Chris Dumez  <cdumez@apple.com>
615
616         Use StringView more in DOMFileSystem code
617         https://bugs.webkit.org/show_bug.cgi?id=176347
618
619         Reviewed by Darin Adler.
620
621         * Modules/entriesapi/DOMFileSystem.cpp:
622         (WebCore::resolveRelativeVirtualPath):
623         (WebCore::DOMFileSystem::evaluatePath):
624         * platform/FileSystem.h:
625         * platform/glib/FileSystemGlib.cpp:
626         (WebCore::pathByAppendingComponents):
627         * platform/posix/FileSystemPOSIX.cpp:
628         (WebCore::pathByAppendingComponents):
629         * platform/win/FileSystemWin.cpp:
630         (WebCore::pathByAppendingComponents):
631
632 2017-09-04  Eric Carlson  <eric.carlson@apple.com>
633
634         Switch HTMLMediaElement to release logging
635         https://bugs.webkit.org/show_bug.cgi?id=176065
636
637         Reviewed by Jer Noble.
638
639         * dom/Document.cpp:
640         (WebCore::Document::privateBrowsingStateDidChange): Disable the logger when private browsing
641         mode is enabled.
642         (WebCore::Document::logger const):
643         * dom/Document.h:
644
645         Convert debug-only logging to configurable release logging.
646         * html/HTMLMediaElement.cpp:
647         (PAL::LogArgument<WebCore::URL>::toString): Logger template for URL that returns the url as a
648         String when only when the LOG_DISABLED build flag is not defined. Returns "[url]" when it is.
649         * html/HTMLMediaElement.h:
650
651 2017-09-04  Sam Weinig  <sam@webkit.org>
652
653         [Canvas] Move non-standard functionality/aliases back to CanvasRenderingContext2D.idl
654         https://bugs.webkit.org/show_bug.cgi?id=176340
655
656         Reviewed by Darin Adler.
657
658         In r221598 (https://webkit.org/b/176276), the CanvasRenderingContext2D was split out into
659         separate interfaces to the match the spec and prepare for implementing OffscreenCanvas. While
660         doing that, related non-standard functionality and aliases were moved as well. In retrospect,
661         that doesn't really makes sense, as we don't want to add these legacy properties to any new
662         interfaces that happen to implement/use the broken out interfaces. Since they are specific
663         to CanvasRenderingContext2D, let's move them back.
664
665         * html/canvas/CanvasCompositing.idl:
666         * html/canvas/CanvasDrawImage.idl:
667         * html/canvas/CanvasFillStrokeStyles.idl:
668         * html/canvas/CanvasImageData.idl:
669         * html/canvas/CanvasImageSmoothing.idl:
670         * html/canvas/CanvasPathDrawingStyles.idl:
671         * html/canvas/CanvasShadowStyles.idl:
672         * html/canvas/CanvasRenderingContext2D.idl:
673
674             Move non-standard operation and attributes back to CanvasRenderingContext2D.idl.
675
676             * html/canvas/CanvasRenderingContext2D.h:
677         * html/canvas/CanvasRenderingContext2D.cpp:
678         (WebCore::CanvasRenderingContext2D::stringForCanvasFillRule): Deleted.
679             
680             Remove unused function.
681
682         (WebCore::CanvasRenderingContext2D::setAlpha): Deleted.
683         (WebCore::CanvasRenderingContext2D::setCompositeOperation): Deleted.
684
685             Removed. Instead, the IDL uses [ImplementedAs] to forward to the 
686             underlying setGlobalAlpha/setGlobalCompositeOperation. This reduces
687             code and makes it clear they are strict aliases.
688
689 2017-09-03  Darin Adler  <darin@apple.com>
690
691         Fix a few minor problems found while working toward removing unneeded calls to updateStyle
692         https://bugs.webkit.org/show_bug.cgi?id=176279
693
694         Reviewed by Antti Koivisto.
695
696         * dom/Document.cpp:
697         (WebCore::Document::updateTitleElement): Fix the algorithm so that an SVG title won't
698         ever become the title when the document element is not an SVG element. We had this wrong
699         before but we were passing the test because SVGTitleElement::insertedInto had a bug that
700         hid the problem.
701         (WebCore::Document::titleElementAdded): Pass a reference instead of a pointer.
702         (WebCore::Document::titleElementRemoved): Pass a reference instead of nullptr since we
703         want to know which element is being removed.
704
705         * dom/Document.h: Update the argument name and type for updateTitleElement.
706
707         * html/HTMLTitleElement.cpp:
708         (WebCore::HTMLTitleElement::insertedInto): Call titleElementAdded unconditionally.
709         The checks to see if the title element is connected to the document and not in the
710         shadow tree are now handled by the Document class.
711         (WebCore::HTMLTitleElement::removedFrom): Same for titleElementRemoved.
712
713         * platform/mock/MockRealtimeVideoSource.cpp:
714         (WebCore::MockRealtimeVideoSource::applySize): Removed incorrect caching of FontCascade
715         objects; these need to be created each time we draw.
716         (WebCore::MockRealtimeVideoSource::drawText): Create all the fonts here. Since this is
717         a mock for testing, there is no real performance concern with doing this.
718         * platform/mock/MockRealtimeVideoSource.h: Removed the FontCascade data members.
719
720         * rendering/RenderTreeAsText.cpp:
721         (WebCore::updateLayoutIgnoringPendingStylesheetsIncludingSubframes): Added. Used below
722         to update layout more thoroughly.
723         (WebCore::externalRepresentation): Update layout of all descendant frames, not just
724         the top level frame.
725
726         * svg/SVGTitleElement.cpp:
727         (WebCore::SVGTitleElement::insertedInto): Removed bogus firstChild check, bogus isSVGDocument
728         check, and unneeded isConnected check and call titleElementAdded unconditionally. The checks
729         are now handled by the Document class.
730         (WebCore::SVGTitleElement::removedFrom): Same for titleElementRemoved.
731
732         * testing/Internals.cpp:
733         (WebCore::Internals::layerTreeAsText const): Added missing updateLayoutIgnorePendingStylesheets,
734         since dumping the layer tree without first doing a layout will yield stale results.
735         (WebCore::Internals::layerIDForElement): Added missing updateLayoutIgnorePendingStylesheets,
736         since using a renderer to check if a layer exists without first doing a layout will yield stale results.
737         (WebCore::Internals::setElementUsesDisplayListDrawing): Ditto.
738         (WebCore::Internals::setElementTracksDisplayListReplay): Ditto.
739         (WebCore::Internals::displayListForElement): Ditto.
740         (WebCore::Internals::replayDisplayListForElement): Ditto.
741         (WebCore::Internals::isSelectPopupVisible): Added missing updateLayoutIgnorePendingStylesheets,
742         since working with the RenderMenuList without first doing a layout will yield stale results.
743         Also removed unneeded strict handling of null renderer, instead just returning false.
744         (WebCore::Internals::isPluginUnavailabilityIndicatorObscured): Removed unnneeded check of
745         renderer class, since the HTMLPlugInElement::isReplacementObscured already handles that correctly.
746         (WebCore::Internals::pageOverlayLayerTreeAsText const): Use updateLayoutIgnorePendingStylesheets
747         instead of the normal updateLayout for consistency with the behavior of the other functions in this
748         file, and because we need a real answer here.
749         (WebCore::Internals::scrollSnapOffsets): Ditto. Also rearranged the code so the renderer check is
750         done after updating the renderer tree.
751
752 2017-09-04  Yusuke Suzuki  <utatane.tea@gmail.com>
753
754         Remove OS(SOLARIS) support
755         https://bugs.webkit.org/show_bug.cgi?id=176341
756
757         Reviewed by Sam Weinig.
758
759         * bindings/scripts/preprocessor.pm:
760         (applyPreprocessor):
761         * dom/make_names.pl:
762         * inspector/InspectorFrontendHost.cpp:
763         (WebCore::InspectorFrontendHost::platform):
764         * page/Page.h:
765
766 2017-09-04  Yusuke Suzuki  <utatane.tea@gmail.com>
767
768         Unreviewed, fixing unused constant for initial buffer size
769         https://bugs.webkit.org/show_bug.cgi?id=176310
770
771         Follow-up patch after r221583. Pointed by darin@.
772
773         * platform/graphics/win/FontPlatformDataWin.cpp:
774         (WebCore::FontPlatformData::FontPlatformData):
775
776 2017-09-04  Sam Weinig  <sam@webkit.org>
777
778         [Canvas] Split CanvasRenderingContext2D.idl into separate IDLs to match current HTML spec
779         https://bugs.webkit.org/show_bug.cgi?id=176276
780
781         Reviewed by Dean Jackson.
782
783         - Splits CanvasRenderingContext2D.idl out into:
784             CanvasState
785             CanvasTransform
786             CanvasCompositing
787             CanvasImageSmoothing
788             CanvasFillStrokeStyles
789             CanvasShadowStyles
790             CanvasFilters
791             CanvasRect
792             CanvasDrawPath
793             CanvasUserInterface
794             CanvasText
795             CanvasDrawImage
796             CanvasImageData
797             CanvasPathDrawingStyles
798             CanvasTextDrawingStyles
799         - Renames CanvasWindingRule enum to CanvasFillRule, and moves it to its own file
800           so it can be reused by multiple IDLs.
801         - Renames DOMPath to Path2D, which is what it is supposed to be called, and doesn't
802           conflict with any WebCore names.
803         - Converts lineCap, lineJoin, textAlign, textBaseline, direction to use enums, rather
804           than DOMStrings, allowing us to remove a bunch of custom parsing.
805         - Non-standard canvas API was grouped with related functionality in the broken out
806           IDLs and clearly marked as non-standard.
807         - Comments were added for places where we break with the standard, mostly around use
808           of float where we should be using double.
809
810         * CMakeLists.txt:
811         * DerivedSources.cpp:
812         * DerivedSources.make:
813         * WebCore.xcodeproj/project.pbxproj:
814         
815             Add new files.
816         
817         * bindings/js/CallTracerTypes.h:
818         * inspector/InspectorCanvas.cpp:
819         (WebCore::InspectorCanvas::buildInitialState):
820         (WebCore::InspectorCanvas::buildAction):
821
822             Update for renames, and use new convertEnumerationToString to
823             serialize enumerations.
824         
825         * bindings/scripts/CodeGeneratorJS.pm:
826         (GenerateEnumerationImplementationContent):
827         (GenerateEnumerationHeaderContent):
828
829             Split string conversion out of convertEnumerationToJS, and into
830             its own function, convertEnumerationToString, to allow serialization
831             to string outside of the bindings context, in this case, for the 
832             InspectorCanvas.
833
834         (GenerateParametersCheck):
835         
836             Improve error message to make it clear which operation has the issue
837             in order to make debugging easier.
838
839         * html/ImageData.idl:
840         
841             Re-order constructors to match specification, and add FIXME for incorrect
842             default argument.
843         
844         * html/TextMetrics.idl:
845             
846             Add spec'd exposure and spec comments, as well a FIXME to convert the
847             unrestricted float parameters should be doubles.
848
849         * html/canvas/CanvasCompositing.idl: Added.
850         * html/canvas/CanvasDirection.h: Added.
851         * html/canvas/CanvasDirection.idl: Added.
852         * html/canvas/CanvasDrawImage.idl: Added.
853         * html/canvas/CanvasDrawPath.idl: Added.
854         * html/canvas/CanvasFillRule.h: Added.
855         * html/canvas/CanvasFillRule.idl: Added.
856         * html/canvas/CanvasFillStrokeStyles.idl: Added.
857         * html/canvas/CanvasFilters.idl: Added.
858         * html/canvas/CanvasImageData.idl: Added.
859         * html/canvas/CanvasImageSmoothing.idl: Added.
860         * html/canvas/CanvasLineCap.h: Added.
861         * html/canvas/CanvasLineCap.idl: Added.
862         * html/canvas/CanvasLineJoin.h: Added.
863         * html/canvas/CanvasLineJoin.idl: Added.
864         * html/canvas/CanvasPathDrawingStyles.idl: Added.
865         * html/canvas/CanvasRect.idl: Added.
866         * html/canvas/CanvasShadowStyles.idl: Added.
867         * html/canvas/CanvasState.idl: Added.
868         * html/canvas/CanvasText.idl: Added.
869         * html/canvas/CanvasTextAlign.h: Added.
870         * html/canvas/CanvasTextAlign.idl: Added.
871         * html/canvas/CanvasTextBaseline.h: Added.
872         * html/canvas/CanvasTextBaseline.idl: Added.
873         * html/canvas/CanvasTextDrawingStyles.idl: Added.
874         * html/canvas/CanvasTransform.idl: Added.
875         * html/canvas/CanvasUserInterface.idl: Added.
876         * html/canvas/ImageSmoothingQuality.h: Added.
877         * html/canvas/ImageSmoothingQuality.idl: Added.
878
879             Move CanvasRenderingContext2D.idl content into separate files to
880             match the specification.
881
882         * html/canvas/CanvasGradient.idl:
883         * html/canvas/CanvasPath.idl:
884         * html/canvas/CanvasPattern.idl:
885
886             Add exposure and FIXMEs on changes need to match the spec.
887
888         * html/canvas/CanvasRenderingContext2D.cpp:
889         * html/canvas/CanvasRenderingContext2D.h:
890
891             Switch to using enums for lineCap, lineJoin, textAlign, textBaseline, and direction.
892             Rather than using the parsing / stringifying functions from GraphicsTypes, add simple
893             switch based to/from converters to convert to/from the canvas type to the platform
894             type. Also update for rename of DOMPath -> Path2D and WindingRule -> CanvasFillRule.
895
896             Unfortunately, not all custom parsing could be removed. To support the legacy functions
897             setLineCap and setLineJoin, which take Strings, two simply parse paths had to be
898             brought back. They can't use the enums, because the rules for enums as parameters
899             is stricter that what was implemented in the custom code (e.g. the bindings would
900             have thrown for strings not in the enum set).
901
902         * html/canvas/CanvasRenderingContext2D.idl:
903
904             Move most of the functions into the new files, which are then 'implemented' by
905             this.
906
907         * html/canvas/DOMPath.cpp: Removed.
908         * html/canvas/DOMPath.h: Removed.
909         * html/canvas/DOMPath.idl: Removed.
910         * html/canvas/Path2D.cpp: Copied from Source/WebCore/html/canvas/DOMPath.cpp.
911         * html/canvas/Path2D.h: Copied from Source/WebCore/html/canvas/DOMPath.h.
912         * html/canvas/Path2D.idl: Copied from Source/WebCore/html/canvas/DOMPath.idl.
913
914             Rename DOMPath to Path2D to match the spec..
915
916         * platform/graphics/GraphicsTypes.cpp:
917         (WebCore::parseLineCap): Deleted.
918         (WebCore::lineCapName): Deleted.
919         (WebCore::parseLineJoin): Deleted.
920         (WebCore::lineJoinName): Deleted.
921         (WebCore::textAlignName): Deleted.
922         (WebCore::parseTextAlign): Deleted.
923         (WebCore::textBaselineName): Deleted.
924         (WebCore::parseTextBaseline): Deleted.
925         * platform/graphics/GraphicsTypes.h:
926
927             Remove now unused parsing / stringifying functions.
928
929         * testing/Internals.cpp:
930
931             Remove unused #include.
932
933         * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
934         * bindings/scripts/test/JS/JSTestCallbackInterface.h:
935         * bindings/scripts/test/JS/JSTestObj.cpp:
936         * bindings/scripts/test/JS/JSTestObj.h:
937         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
938         * bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
939         * bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp:
940         * bindings/scripts/test/JS/JSTestStandaloneEnumeration.h:
941
942             Update test results to add convertEnumerationToString.
943
944 2017-09-03  Darin Adler  <darin@apple.com>
945
946         Follow up FrameView::updateLayoutAndStyleIfNeededRecursive changes with related improvements
947         https://bugs.webkit.org/show_bug.cgi?id=176277
948
949         Reviewed by Antti Koivisto.
950
951         * page/FrameView.cpp:
952         (WebCore::FrameView::needsStyleRecalcOrLayout): Deleted. This function was only used
953         by an assertion inside updateLayoutAndStyleIfNeededRecursive, and thus there is no reason
954         for it to be in the header file, or for it to be a public member function.
955         (WebCore::appendRenderedChildren): Deleted. This function was only used inside
956         updateLayoutAndStyleIfNeededRecursive, and it is now packaged in an even better way
957         for efficient use inside that function.
958         (WebCore::FrameView::renderedChildFrameViews): Deleted. This function was only used
959         inside needsStyleRecalcOrLayout, and it's now packaged in a better way inside that function.
960         (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive): Created a new lambda called
961         nextRendereredDescendant that packages up the process of repeatedly iterating this view
962         and all of its descendants in an easy-to-use way. Replaces both of the functions above.
963         Rewrote to use it; it made the logic clear enough that it was good to get rid of the
964         updateOneFrame lambda, too. Added two separate functions, one that checks for needed
965         style recalculation and a separate one that checked for needed layout. Using those,
966         replaced the old single assertion with two separate assertions.
967
968         * page/FrameView.h: Removed needsStyleRecalcOrLayout, renderedChildFrameViews, and
969         FrameViewList.
970
971 2017-09-04  Wenson Hsieh  <wenson_hsieh@apple.com>
972
973         [iOS DnD] Refactor drag and drop logic in WKContentView in preparation for supporting multiple drag items in a drag session
974         https://bugs.webkit.org/show_bug.cgi?id=176264
975         <rdar://problem/31144674>
976
977         Reviewed by Darin Adler.
978
979         Makes some small adjustments to WebItemProviderPasteboard. Rather than just -setItemProviders: on the
980         WebItemProviderPasteboard when initiating a drag, also stage the WebItemProviderRegistrationList that will be
981         used to generate an item provider. While it would be cleaner to avoid directly setting item providers so we
982         don't overwrite item providers on the WebItemProviderPasteboard when adding items to an existing drag session,
983         this isn't possible without breaking binary compability with older UIKit versions.
984
985         Importantly, WKContentView will now ignore any item providers that have been set on the
986         WebItemProviderPasteboard when initiating a drag or adding items to an existing drag session, and instead only
987         consider the staged registration list when generating item providers for dragging. This only has the drawback of
988         generating an unnecessary item provider, but otherwise maintains backwards compatibility while allowing us to
989         provide WebKit2 support for multiple items per drag session.
990
991         Tests: DataInteractionTests.DragEventClientCoordinatesBasic
992                DataInteractionTests.DragEventClientCoordinatesWithScrollOffset
993                DataInteractionTests.DragEventPageCoordinatesBasic
994                DataInteractionTests.DragEventPageCoordinatesWithScrollOffset
995
996         * platform/ios/AbstractPasteboard.h:
997         * platform/ios/PlatformPasteboardIOS.mm:
998         (WebCore::registerItemToPasteboard):
999
1000         Changed to only stage registration info on the item provider pasteboard, if possible. This has no effect on the
1001         copy/paste codepath, since it uses a UIPasteboard.
1002
1003         * platform/ios/WebItemProviderPasteboard.h:
1004         * platform/ios/WebItemProviderPasteboard.mm:
1005
1006         Rename _registrationInfoLists to _stagedRegistrationInfoList, and change it from an array of registration info
1007         lists to a single registration info list. This could be updated in the future to be an array of registration
1008         lists, but currently, it serves no purpose and makes coordination with DragItem info more difficult. This would
1009         need to support multiple registration lists if we are to add a way to begin a drag containing multiple items in
1010         vanilla web content, such as dragging multiple selections.
1011
1012         (-[WebItemProviderPasteboard init]):
1013         (-[WebItemProviderPasteboard setItemProviders:]):
1014         (-[WebItemProviderPasteboard stageRegistrationList:]):
1015
1016         Sets the staged item provider registration list.
1017
1018         (-[WebItemProviderPasteboard takeRegistrationList]):
1019
1020         Removes the staged item provider registration list from the WebItemProviderPasteboard and also returns it.
1021
1022         (-[WebItemProviderPasteboard registrationInfoAtIndex:]): Deleted.
1023         (-[WebItemProviderPasteboard setRegistrationInfoLists:]): Deleted.
1024
1025 2017-09-04  Commit Queue  <commit-queue@webkit.org>
1026
1027         Unreviewed, rolling out r221494 and r221500.
1028         https://bugs.webkit.org/show_bug.cgi?id=176258
1029
1030         This caused the windows build to fail. (Requested by mlewis13
1031         on #webkit).
1032
1033         Reverted changesets:
1034
1035         "Switch HTMLMediaElement to release logging"
1036         https://bugs.webkit.org/show_bug.cgi?id=176065
1037         http://trac.webkit.org/changeset/221494
1038
1039         "Switch HTMLMediaElement to release logging"
1040         https://bugs.webkit.org/show_bug.cgi?id=176065
1041         http://trac.webkit.org/changeset/221500
1042
1043 2017-09-04  Sam Weinig  <sam@webkit.org>
1044
1045         [WebIDL] Simplify EnabledBySettings generation
1046         https://bugs.webkit.org/show_bug.cgi?id=176312
1047
1048         Reviewed by Darin Adler.
1049
1050         * bindings/scripts/CodeGeneratorJS.pm:
1051         (NeedsRuntimeCheck):
1052         (OperationShouldBeOnInstance):
1053         (GeneratePropertiesHashTable):
1054         (GenerateRuntimeEnableConditionalString):
1055         (GenerateImplementation):
1056         (GenerateAttributeGetterBodyDefinition):
1057
1058             - Simplify the [EnabledBySetting] code generation by merging it with the other
1059             runtime checks (Exposed, EnabledAtRuntime, EnabledForWorld, and SecureContext).
1060
1061             - Switches to using WebCoreBuiltinNames for identifiers, rather than relying
1062             on the appropriate identifiers being available on JavaScriptCore's CommonIdentifiers
1063             which was an unnecessary layering violation. There are still problems with this
1064             as we continue to be inconsistent  about which identifiers deserve to be in 
1065             WebCoreBuiltinNames, and which ones can be created each time and there is no
1066             automation of WebCoreBuiltinNames from the IDLs.
1067
1068             - Enforce at code generation time that [EnabledBySetting] can only be used
1069             on interfaces that are uniquely exposed to the window environment. This is a
1070             condition we should find a way to remove (e.g. propagating necessary settings 
1071             to an object the ScriptExecutionContext owns), but for now, Settings is a main
1072             thread only object.
1073
1074         * bindings/js/JSDOMWindowCustom.cpp:
1075         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
1076         (WebCore::JSDOMWindow::getOwnPropertySlot):
1077         (WebCore::JSDOMWindow::put):
1078         (WebCore::addCrossOriginWindowPropertyNames):
1079         (WebCore::addCrossOriginWindowOwnPropertyNames):
1080
1081             Switch to using WebCoreBuiltinNames for WebCore specific identifiers.
1082
1083         * bindings/js/WebCoreBuiltinNames.h:
1084
1085             Add WebCore specific identifiers from JavaScriptCore's CommonIdentifiers
1086             as well as some new ones need by the [EnableBySetting] unification.
1087
1088         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp: Added.
1089         * bindings/scripts/test/JS/JSTestEnabledBySetting.h: Added.
1090         * bindings/scripts/test/TestEnabledBySetting.idl: Added.
1091
1092             Add new test for [EnabledBySetting].
1093
1094         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
1095         * bindings/scripts/test/JS/JSTestObj.cpp:
1096         * bindings/scripts/test/TestObj.idl:
1097
1098             Remove use of [EnabledBySetting] from TestObj, as it is no longer
1099             valid to use [EnabledBySetting] on interfaces that are no uniquely
1100             exposed to the window environment.
1101
1102 2017-09-03  Yusuke Suzuki  <utatane.tea@gmail.com>
1103
1104         Remove "malloc" and "free" use
1105         https://bugs.webkit.org/show_bug.cgi?id=176310
1106
1107         Reviewed by Darin Adler.
1108
1109         Use MallocPtr<>, fastMalloc/fastFree, or Vector instead of manual call of system malloc/free.
1110         In this patch, we apply the above change if we can easily find the pair of malloc/free.
1111         And we do not touch plugin directory since the external code could call free() onto the
1112         fastMalloc-ed memory.
1113
1114         Also, we still use malloc if the system adopts the allocated memory. Later, the system
1115         will deallocate it by calling the system "free".
1116
1117         * platform/audio/mac/FFTFrameMac.cpp:
1118         (WebCore::FFTFrame::fftSetupForSize):
1119         (WebCore::FFTFrame::cleanup):
1120         * platform/graphics/win/FontCacheWin.cpp:
1121         (WebCore::getLinkedFonts):
1122         * platform/graphics/win/FontCustomPlatformData.cpp:
1123         (WebCore::FontCustomPlatformData::fontPlatformData):
1124         * platform/graphics/win/FontPlatformDataWin.cpp:
1125         (WebCore::FontPlatformData::FontPlatformData):
1126         * platform/mac/WebCoreNSURLExtras.mm:
1127         (WebCore::URLByTruncatingOneCharacterBeforeComponent):
1128         (WebCore::dataForURLComponentType):
1129         (WebCore::URLByRemovingComponentAndSubsequentCharacter):
1130         (WebCore::createStringWithEscapedUnsafeCharacters):
1131         (WebCore::userVisibleString):
1132         * platform/win/ClipboardUtilitiesWin.cpp:
1133         (WebCore::markupToCFHTML):
1134
1135 2017-09-03  Chris Dumez  <cdumez@apple.com>
1136
1137         Use StringView in DOMFileSystem::evaluatePath()
1138         https://bugs.webkit.org/show_bug.cgi?id=176324
1139
1140         Reviewed by Darin Adler.
1141
1142         Use StringView in DOMFileSystem::evaluatePath() for performance.
1143
1144         * Modules/entriesapi/DOMFileSystem.cpp:
1145         (WebCore::resolveRelativeVirtualPath):
1146         (WebCore::DOMFileSystem::evaluatePath):
1147         * Modules/entriesapi/DOMFileSystem.h:
1148
1149 2017-09-03  Yusuke Suzuki  <utatane.tea@gmail.com>
1150
1151         String#utf8() allocates new CString
1152         https://bugs.webkit.org/show_bug.cgi?id=176302
1153
1154         Reviewed by Sam Weinig.
1155
1156         Several places uses String#utf8() like an accessor. In reality, it allocates new CString per call.
1157         It is very costly. Furthermore, some places uses this incorrectly. For example,
1158         `std::vector<char>(srtpAuth.utf8().data(), srtpAuth.utf8().data() + srtpAuth.utf8().length());`
1159         is incorrect since each time strpAuth.utf8() allocates different CString.
1160
1161         This patch calls utf8() first and use it.
1162
1163         * Modules/websockets/WebSocketChannel.cpp:
1164         (WebCore::WebSocketChannel::startClosingHandshake):
1165         * platform/wpe/PlatformPasteboardWPE.cpp:
1166         (WebCore::PlatformPasteboard::write):
1167
1168 2017-09-03  Yusuke Suzuki  <utatane.tea@gmail.com>
1169
1170         [SOUP] Use fastMalloced SoupBuffer in ResourcehandleSoup
1171         https://bugs.webkit.org/show_bug.cgi?id=176311
1172
1173         Reviewed by Michael Catanzaro.
1174
1175         Use fastMalloced memory instead of g_malloc for SoupBuffer.
1176
1177         * platform/network/soup/ResourceHandleSoup.cpp:
1178         (WebCore::ResourceHandle::ensureReadBuffer):
1179
1180 2017-09-03  Chris Dumez  <cdumez@apple.com>
1181
1182         Have getFileMetadata() return a std::optional<FileMetadata>
1183         https://bugs.webkit.org/show_bug.cgi?id=176293
1184
1185         Reviewed by Darin Adler.
1186
1187         Have getFileMetadata() return a std::optional<FileMetadata> instead of
1188         using an out parameter for the metadata.
1189
1190         * Modules/entriesapi/DOMFileSystem.cpp:
1191         (WebCore::listDirectoryWithMetadata):
1192         (WebCore::validatePathIsExpectedType):
1193         (WebCore::DOMFileSystem::getEntry):
1194         * html/FileListCreator.cpp:
1195         (WebCore::appendDirectoryFiles):
1196         * platform/FileSystem.cpp:
1197         (WebCore::fileIsDirectory):
1198         * platform/FileSystem.h:
1199         * platform/glib/FileSystemGlib.cpp:
1200         (WebCore::getFileMetadata):
1201         * platform/network/BlobDataFileReference.cpp:
1202         (WebCore::BlobDataFileReference::startTrackingModifications):
1203         * platform/network/mac/BlobDataFileReferenceMac.mm:
1204         (WebCore::BlobDataFileReference::generateReplacementFile):
1205         * platform/posix/FileSystemPOSIX.cpp:
1206         (WebCore::getFileMetadata):
1207         * platform/win/FileSystemWin.cpp:
1208         (WebCore::getFileMetadata):
1209
1210 2017-09-03  Sam Weinig  <sam@webkit.org>
1211
1212         Remove CanvasProxy
1213         https://bugs.webkit.org/show_bug.cgi?id=176288
1214
1215         Reviewed by Yusuke Suzuki.
1216
1217         CanvasProxy does not appear to be in any current HTML spec
1218         and was disabled and unimplemented in our tree. Time to 
1219         get rid of it.
1220
1221         * CMakeLists.txt:
1222         * Configurations/FeatureDefines.xcconfig:
1223         * DerivedSources.cpp:
1224         * DerivedSources.make:
1225         * WebCore.xcodeproj/project.pbxproj:
1226         * html/canvas/CanvasProxy.cpp: Removed.
1227         * html/canvas/CanvasProxy.h: Removed.
1228         * html/canvas/CanvasProxy.idl: Removed.
1229
1230 2017-09-02  Sam Weinig  <sam@webkit.org>
1231
1232         DOMMatrix/DOMMatrixReadOnly validation is incorrect for NaN values
1233         https://bugs.webkit.org/show_bug.cgi?id=176287
1234
1235         Reviewed by Chris Dumez.
1236
1237         * css/DOMMatrixReadOnly.cpp:
1238         (WebCore::sameValueZero): Added.
1239         (WebCore::DOMMatrixReadOnly::validateAndFixup):
1240
1241             Switch from using standard != to added sameValueZero helper
1242             which implements https://tc39.github.io/ecma262/#sec-samevaluezero
1243
1244 2017-09-02  Chris Dumez  <cdumez@apple.com>
1245
1246         Implement FileSystemFileEntry.file()
1247         https://bugs.webkit.org/show_bug.cgi?id=176166
1248         <rdar://problem/34187756>
1249
1250         Reviewed by Sam Weinig.
1251
1252         Implement FileSystemFileEntry.file():
1253         - https://wicg.github.io/entries-api/#dom-filesystemfileentry-file
1254
1255         Test: editing/pasteboard/datatransfer-items-drop-fileEntry-file.html
1256
1257         * Modules/entriesapi/DOMFileSystem.cpp:
1258         (WebCore::validatePathIsExpectedType):
1259         (WebCore::DOMFileSystem::listDirectory):
1260         (WebCore::DOMFileSystem::getParent):
1261         (WebCore::DOMFileSystem::getFile):
1262         * Modules/entriesapi/DOMFileSystem.h:
1263         * Modules/entriesapi/FileSystemFileEntry.cpp:
1264         (WebCore::FileSystemFileEntry::file):
1265
1266 2017-09-02  Andy Estes  <aestes@apple.com>
1267
1268         [CA] Upstream QuartzCore-related WebKitSystemInterface functions
1269         https://bugs.webkit.org/show_bug.cgi?id=176270
1270
1271         Reviewed by Tim Horton.
1272
1273         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1274         (PlatformCALayerCocoa::enumerateRectsBeingDrawn):
1275         * platform/graphics/cocoa/WebCoreCALayerExtras.h:
1276         * platform/graphics/cocoa/WebCoreCALayerExtras.mm:
1277         (+[CALayer _web_renderLayerWithContextID:]):
1278         * platform/ios/WebCoreSystemInterfaceIOS.mm:
1279         * platform/mac/WebCoreSystemInterface.h:
1280         * platform/mac/WebCoreSystemInterface.mm:
1281
1282 2017-09-02  Emilio Cobos Álvarez  <emilio@crisal.io>
1283
1284         Wrong getComputedStyle result for pseudo-elements in display: none subtrees.
1285         https://bugs.webkit.org/show_bug.cgi?id=176259
1286
1287         Reviewed by Antti Koivisto.
1288
1289         Before this patch, we were wrongly returning the parent style when there wasn't
1290         a cached pseudo style.
1291
1292         With this, the only remaining failures in getComputedStyle-pseudo is a
1293         serialisation bug for the "content" property, and the display: contents test,
1294         which is because we don't support pseudo-elements of display: contents elements
1295         yet.
1296
1297         Tests: imported/w3c/web-platform-tests/cssom/getComputedStyle-pseudo.html
1298
1299         * dom/Document.cpp:
1300         (WebCore::Document::styleForElementIgnoringPendingStylesheets):
1301         * dom/Document.h:
1302         * dom/Element.cpp:
1303         (WebCore::Element::resolvePseudoElementStyle):
1304         (WebCore::Element::computedStyle):
1305         * dom/Element.h:
1306
1307 2017-09-02  Chris Dumez  <cdumez@apple.com>
1308
1309         Implement FileSystemDirectoryEntry.getDirectory()
1310         https://bugs.webkit.org/show_bug.cgi?id=176168
1311         <rdar://problem/34187787>
1312
1313         Reviewed by Darin Adler.
1314
1315         Implement FileSystemDirectoryEntry.getDirectory() as per:
1316         - https://wicg.github.io/entries-api/#dom-filesystemdirectoryentry-getdirectory
1317
1318         Test: editing/pasteboard/datatransfer-items-drop-getDirectory.html
1319
1320         * Modules/entriesapi/DOMFileSystem.cpp:
1321         (WebCore::isValidVirtualPath):
1322         (WebCore::resolveRelativeVirtualPath):
1323         (WebCore::DOMFileSystem::getEntry):
1324         * Modules/entriesapi/DOMFileSystem.h:
1325         * Modules/entriesapi/FileSystemDirectoryEntry.cpp:
1326         (WebCore::FileSystemDirectoryEntry::getEntry):
1327         (WebCore::FileSystemDirectoryEntry::getFile):
1328         (WebCore::FileSystemDirectoryEntry::getDirectory):
1329         * Modules/entriesapi/FileSystemDirectoryEntry.h:
1330
1331 2017-09-02  Joseph Pecoraro  <pecoraro@apple.com>
1332
1333         Performance / PerformanceObserver leaks seen on bots
1334         https://bugs.webkit.org/show_bug.cgi?id=176269
1335
1336         Reviewed by Darin Adler.
1337
1338         * page/DOMWindow.cpp:
1339         (WebCore::DOMWindow::removeAllEventListeners):
1340         * workers/WorkerGlobalScope.cpp:
1341         (WebCore::WorkerGlobalScope::removeAllEventListeners):
1342         Also use this opportunity to break up the reference cycle
1343         between PerformanceObservers and the Performance object.
1344
1345         * page/Performance.h:
1346         * page/Performance.cpp:
1347         (WebCore::Performance::removeAllObservers):
1348         Disassociate and clear observers.
1349
1350         * page/PerformanceObserver.h:
1351         * page/PerformanceObserver.cpp:
1352         (WebCore::PerformanceObserver::disassociate):
1353         Clear the back-reference to the Performance object to
1354         break the cycle.
1355
1356 2017-09-02  Carlos Garcia Campos  <cgarcia@igalia.com>
1357
1358         [GTK][Wayland] Use fast malloc to allocate backing store cairo surfaces data
1359         https://bugs.webkit.org/show_bug.cgi?id=176226
1360
1361         Reviewed by Michael Catanzaro.
1362
1363         It reduces the memory consumption and improves the performance. Also, since performance is better we don't need
1364         to keep the scroll surface allocated all the time, we can create it on demand and keep it allocated only while
1365         scrolling too fast.
1366
1367         * platform/graphics/cairo/BackingStoreBackendCairoImpl.cpp:
1368         (WebCore::createCairoImageSurfaceWithFastMalloc): Helper to create a cairo image surface using fast malloc.
1369         (WebCore::BackingStoreBackendCairoImpl::BackingStoreBackendCairoImpl): Create the main surface, but no the
1370         scroll one. Initialize the hysteresis activity to discard the scroll surface after scrolling.
1371         (WebCore::BackingStoreBackendCairoImpl::scroll): Create the scroll surface only if it's nullptr, and notify the
1372         hysteresis activity.
1373         * platform/graphics/cairo/BackingStoreBackendCairoImpl.h:
1374
1375 2017-09-01  Sam Weinig  <sam@webkit.org>
1376
1377         DOMMatrix and DOMMatrixReadOnly should be available in workers
1378         https://bugs.webkit.org/show_bug.cgi?id=176255
1379
1380         Reviewed by Simon Fraser.
1381
1382         * WebCore.xcodeproj/project.pbxproj:
1383
1384             Add GlobalPerformance.idl to the project. It was missing.
1385
1386         * bindings/scripts/CodeGeneratorJS.pm:
1387         (IsAlwaysExposedOnInterface):
1388         (NeedsRuntimeCheck):
1389         (GenerateRuntimeEnableConditionalStringForExposed):
1390         (GenerateRuntimeEnableConditionalString):
1391
1392             Adds support for [Exposed] extended attributes on operations, attributes and
1393             constants. This allows an interface that is exposed to both windows and workers 
1394             (with [Exposed=(Window,Worker)]), to indicate that a specific property should
1395             only be be exposed somewhere, e.g only the window. This is need by DOMMatrixReadOnly's
1396             stringifier, which is only exposed in the window environment.
1397
1398         * bindings/scripts/IDLParser.pm:
1399         (parseExtendedAttributeRest2):
1400
1401             Fix bug where array extended attributes, like those found in Exposed expressions
1402             where being converter to scalars.
1403
1404         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1405         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
1406         * bindings/scripts/test/JS/JSTestObj.cpp:
1407         * bindings/scripts/test/TestObj.idl:
1408
1409             Add tests and update results. Some results are just improved
1410             includes.
1411
1412         * css/DOMMatrix.cpp:
1413         * css/DOMMatrix.h:
1414         * css/DOMMatrix.idl:
1415         * css/DOMMatrixReadOnly.cpp:
1416         * css/DOMMatrixReadOnly.h:
1417         * css/DOMMatrixReadOnly.idl:
1418             
1419             Expose DOMMatrix and DOMMatrixReadOnly to workers and update the constructors
1420             to match the current spec, throwing if the argument is a string, and the context
1421             is not the window / document context. Also did some refactoring to avoid allocating
1422             the DOMMatrix or DOMMatrixReadOnly until after all the exceptional cases were handled.
1423
1424 2017-09-01  Chris Dumez  <cdumez@apple.com>
1425
1426         Implement FileSystemDirectoryEntry.getFile()
1427         https://bugs.webkit.org/show_bug.cgi?id=176167
1428         <rdar://problem/34187775>
1429
1430         Reviewed by Andreas Kling.
1431
1432         Implement FileSystemDirectoryEntry.getFile():
1433         - https://wicg.github.io/entries-api/#dom-filesystemdirectoryentry-getfile
1434
1435         Test: editing/pasteboard/datatransfer-items-drop-getFile.html
1436
1437         * Modules/entriesapi/DOMFileSystem.cpp:
1438         (WebCore::isValidPathNameCharacter):
1439         (WebCore::isValidPathSegment):
1440         (WebCore::isValidRelativeVirtualPath):
1441         (WebCore::isValidAbsoluteVirtualPath):
1442         (WebCore::isValidVirtualPath):
1443         Implement various path validation functions as per:
1444         - https://wicg.github.io/entries-api/#names-paths
1445
1446         (WebCore::resolveRelativeVirtualPath):
1447         - Use StringView for second parameter for efficiency. Had to keep
1448           a String for the first parameter because I need the split to
1449           return a Vector.
1450         - If the input path is absolute, call recursively with '/' as
1451           base path so that the virtual path gets sanitized (i.e. '..'
1452           and '.' in the absolute URL get resolved).
1453
1454         (WebCore::DOMFileSystem::listDirectory):
1455         Use String instead of auto. It is not much longer and is clearer.
1456
1457         (WebCore::validatePathIsDirectory):
1458         (WebCore::DOMFileSystem::getParent):
1459         Move logic to validate that the path is a directory from getParent() to a
1460         separate function. This only makes sure the ScriptExecutionContext is only
1461         ref'd / deref'd on the main thread.
1462
1463         (WebCore::validatePathIsFile):
1464         Logic for validating that a path is a file, used by getFile().
1465
1466         (WebCore::DOMFileSystem::getFile):
1467         Implement getFile() as per:
1468         - https://wicg.github.io/entries-api/#dom-filesystemdirectoryentry-getfile
1469
1470         * Modules/entriesapi/DOMFileSystem.h:
1471         * Modules/entriesapi/FileSystemDirectoryEntry.cpp:
1472         (WebCore::FileSystemDirectoryEntry::getFile):
1473         Add implementation of FileSystemDirectoryEntry::getFile() which merely calls
1474         DOMFileSystem::getFile().
1475
1476 2017-09-01  Brady Eidson  <beidson@apple.com>
1477
1478         ASSERTION FAILED: taken.get() == &job in WebCore::ServiceWorkerContainer::jobDidFinish(WebCore::ServiceWorkerJob &).
1479         https://bugs.webkit.org/show_bug.cgi?id=176234
1480
1481         Rubberstamped by Tim Horton, reluctantly.
1482
1483         * workers/service/ServiceWorkerContainer.cpp:
1484         (WebCore::ServiceWorkerContainer::jobDidFinish): It's valid for the job to be missing after navigations, which is
1485           why this was hitting downstream tests.
1486
1487 2017-09-01  Youenn Fablet  <youenn@apple.com>
1488
1489         Do not Reject CacheStorage promises when updating the persistent filesystem data fails
1490         https://bugs.webkit.org/show_bug.cgi?id=176241
1491
1492         Reviewed by Alex Christensen.
1493
1494         Open/Remove caches may succeed in updating the memory representation but the write-to-disk operation may fail.
1495         In that case, the corresponding promise is now resolved since the web page can still proceeed.
1496
1497         There is no way to test that currently as this would require a write disk failure to be triggered.
1498
1499         * Modules/cache/CacheStorage.cpp:
1500         (WebCore::logConsolePersistencyError):
1501         (WebCore::CacheStorage::open):
1502         (WebCore::CacheStorage::remove):
1503         * Modules/cache/DOMCacheEngine.h:
1504         (WebCore::DOMCacheEngine::CacheIdentifierOperationResult::encode const):
1505         (WebCore::DOMCacheEngine::CacheIdentifierOperationResult::decode):
1506
1507 2017-09-01  Youenn Fablet  <youenn@apple.com>
1508
1509         [Fetch API] Add support for consuming a Request ReadableStream body
1510         https://bugs.webkit.org/show_bug.cgi?id=176182
1511
1512         Reviewed by Alex Christensen.
1513
1514         Tests: http/wpt/fetch/request-stream-empty.html
1515                http/wpt/fetch/request-stream-error.html
1516
1517         Adding a ReadableStreamSink which allows to pipe all ReadableStream data back to C++ code.
1518         This sink only takes BufferSource as the only user is Fetch which has this restriction.
1519         This sink is tied to the readableStreamPipeTo builtin internal function that reads all data from the ReadableStream
1520         and send it to the sink.
1521
1522         Adding a ReadableStreamToSharedBufferSink specialization to get the data as a SharedBuffer.
1523
1524         Use that class in FetchBodyConsumer to get the data back from the ReadableStream and transform it according
1525         the desired body type (text, JSON, ArrayBuffer).
1526
1527         * CMakeLists.txt:
1528         * DerivedSources.make:
1529         * Modules/fetch/FetchBody.cpp:
1530         (WebCore::FetchBody::consume):
1531         (WebCore::FetchBody::loadingSucceeded):
1532         * Modules/fetch/FetchBodyConsumer.cpp:
1533         (WebCore::resolveWithTypeAndData):
1534         (WebCore::FetchBodyConsumer::clean):
1535         (WebCore::FetchBodyConsumer::resolveWithData):
1536         (WebCore::FetchBodyConsumer::resolve):
1537         * Modules/fetch/FetchBodyConsumer.h:
1538         * Modules/fetch/FetchResponse.cpp:
1539         (WebCore::FetchResponse::finishConsumingStream):
1540         * Modules/streams/ReadableStreamInternals.js:
1541         (readableStreamPipeTo):
1542         * Modules/streams/ReadableStreamSink.cpp: Added.
1543         (WebCore::ReadableStreamToSharedBufferSink::ReadableStreamToSharedBufferSink):
1544         (WebCore::ReadableStreamToSharedBufferSink::pipeFrom):
1545         (WebCore::ReadableStreamToSharedBufferSink::enqueue):
1546         (WebCore::ReadableStreamToSharedBufferSink::close):
1547         (WebCore::ReadableStreamToSharedBufferSink::error):
1548         * Modules/streams/ReadableStreamSink.h: Added.
1549         * Modules/streams/ReadableStreamSink.idl: Added.
1550         * WebCore.xcodeproj/project.pbxproj:
1551         * bindings/js/ReadableStream.cpp:
1552         (WebCore::ReadableStream::pipeTo):
1553         * bindings/js/ReadableStream.h:
1554
1555 2017-09-01  Emilio Cobos Álvarez  <emilio@crisal.io>
1556
1557         Wrong getComputedStyle behavior for pseudo-elements for layout-dependent properties.
1558         https://bugs.webkit.org/show_bug.cgi?id=175936
1559
1560         Reviewed by Antti Koivisto.
1561
1562         Before this patch we may wrongly end up using the wrong renderer to resolve
1563         this.
1564
1565         Tests: imported/w3c/web-platform-tests/cssom/getComputedStyle-pseudo.html
1566
1567         * css/CSSComputedStyleDeclaration.cpp:
1568         (WebCore::ComputedStyleExtractor::styledElement const):
1569         (WebCore::ComputedStyleExtractor::styledRenderer const):
1570         (WebCore::ComputedStyleExtractor::propertyValue):
1571         * css/CSSComputedStyleDeclaration.h:
1572
1573 2017-09-01  Per Arne Vollan  <pvollan@apple.com>
1574
1575         [Win] Compile error, 'Cache' is not declared.
1576         https://bugs.webkit.org/show_bug.cgi?id=176062
1577
1578         Reviewed by Youenn Fablet.
1579
1580         Rename Cache to DOMCache.
1581
1582         No new tests, covered by existing tests. 
1583
1584         * DerivedSources.make:
1585         * Modules/cache/Cache.cpp: Removed.
1586         * Modules/cache/Cache.h: Removed.
1587         * Modules/cache/Cache.idl: Removed.
1588         * Modules/cache/CacheStorage.cpp:
1589         (WebCore::doSequentialMatch):
1590         (WebCore::startSequentialMatch):
1591         (WebCore::copyCaches):
1592         (WebCore::CacheStorage::match):
1593         (WebCore::CacheStorage::retrieveCaches):
1594         (WebCore::CacheStorage::open):
1595         * Modules/cache/CacheStorage.h:
1596         * Modules/cache/DOMCache.cpp: Copied from Source/WebCore/Modules/cache/Cache.cpp.
1597         (WebCore::DOMCache::DOMCache):
1598         (WebCore::DOMCache::~DOMCache):
1599         (WebCore::DOMCache::match):
1600         (WebCore::DOMCache::doMatch):
1601         (WebCore::DOMCache::matchAll):
1602         (WebCore::DOMCache::add):
1603         (WebCore::DOMCache::requestFromInfo):
1604         (WebCore::DOMCache::addAll):
1605         (WebCore::DOMCache::put):
1606         (WebCore::DOMCache::remove):
1607         (WebCore::DOMCache::keys):
1608         (WebCore::DOMCache::retrieveRecords):
1609         (WebCore::DOMCache::queryCache):
1610         (WebCore::DOMCache::queryCacheWithTargetStorage):
1611         (WebCore::DOMCache::batchDeleteOperation):
1612         (WebCore::DOMCache::batchPutOperation):
1613         (WebCore::DOMCache::updateRecords):
1614         (WebCore::DOMCache::stop):
1615         (WebCore::DOMCache::activeDOMObjectName const):
1616         (WebCore::DOMCache::canSuspendForDocumentSuspension const):
1617         (WebCore::Cache::Cache): Deleted.
1618         (WebCore::Cache::~Cache): Deleted.
1619         (WebCore::Cache::match): Deleted.
1620         (WebCore::Cache::doMatch): Deleted.
1621         (WebCore::Cache::matchAll): Deleted.
1622         (WebCore::Cache::add): Deleted.
1623         (WebCore::Cache::requestFromInfo): Deleted.
1624         (WebCore::Cache::addAll): Deleted.
1625         (WebCore::Cache::put): Deleted.
1626         (WebCore::Cache::remove): Deleted.
1627         (WebCore::Cache::keys): Deleted.
1628         (WebCore::Cache::retrieveRecords): Deleted.
1629         (WebCore::Cache::queryCache): Deleted.
1630         (WebCore::Cache::queryCacheWithTargetStorage): Deleted.
1631         (WebCore::Cache::batchDeleteOperation): Deleted.
1632         (WebCore::Cache::batchPutOperation): Deleted.
1633         (WebCore::Cache::updateRecords): Deleted.
1634         (WebCore::Cache::stop): Deleted.
1635         (WebCore::Cache::activeDOMObjectName const): Deleted.
1636         (WebCore::Cache::canSuspendForDocumentSuspension const): Deleted.
1637         * Modules/cache/DOMCache.h: Copied from Source/WebCore/Modules/cache/Cache.h.
1638         * Modules/cache/DOMCache.idl: Copied from Source/WebCore/Modules/cache/Cache.idl.
1639         * WebCore.xcodeproj/project.pbxproj:
1640
1641 2017-09-01  Brady Eidson  <beidson@apple.com>
1642
1643         Move ServiceWorkerJob from FetchLoader to ThreadableLoader.
1644         https://bugs.webkit.org/show_bug.cgi?id=176231
1645
1646         Reviewed by Youenn Fablet.
1647
1648         No new tests (No behavior change).
1649
1650         * WebCore.xcodeproj/project.pbxproj:
1651
1652         Re-indent these headers. Yuck!
1653         * loader/ThreadableLoader.h:
1654         (WebCore::ThreadableLoader::ref):
1655         (WebCore::ThreadableLoader::deref):
1656         (WebCore::ThreadableLoader::ThreadableLoader):
1657         (WebCore::ThreadableLoader::~ThreadableLoader):
1658         * loader/ThreadableLoaderClient.h:
1659         (WebCore::ThreadableLoaderClient::didSendData):
1660         (WebCore::ThreadableLoaderClient::didReceiveResponse):
1661         (WebCore::ThreadableLoaderClient::didReceiveData):
1662         (WebCore::ThreadableLoaderClient::didFinishLoading):
1663         (WebCore::ThreadableLoaderClient::didFail):
1664         (WebCore::ThreadableLoaderClient::didFinishTiming):
1665         (WebCore::ThreadableLoaderClient::ThreadableLoaderClient):
1666         (WebCore::ThreadableLoaderClient::~ThreadableLoaderClient):
1667
1668         Move from FetchLoaderClient to ThreadableLoaderClient:
1669         * workers/service/ServiceWorkerJob.cpp:
1670         (WebCore::ServiceWorkerJob::fetchScriptWithContext):
1671         (WebCore::ServiceWorkerJob::didReceiveResponse):
1672         (WebCore::ServiceWorkerJob::didReceiveData):
1673         (WebCore::ServiceWorkerJob::didFinishLoading):
1674         (WebCore::ServiceWorkerJob::didFail):
1675         (WebCore::ServiceWorkerJob::didSucceed): Deleted.
1676         * workers/service/ServiceWorkerJob.h:
1677
1678         * workers/service/server/SWClientConnection.cpp: Add a now-required include.
1679
1680 2017-09-01  Eric Carlson  <eric.carlson@apple.com>
1681
1682         Switch HTMLMediaElement to release logging
1683         https://bugs.webkit.org/show_bug.cgi?id=176065
1684
1685         Reviewed by Jer Noble.
1686
1687         * dom/Document.cpp:
1688         (WebCore::Document::privateBrowsingStateDidChange): Disable the logger when private browsing
1689         mode is enabled.
1690         (WebCore::Document::logger const):
1691         * dom/Document.h:
1692
1693         Convert debug-only logging to configurable release logging.
1694         * html/HTMLMediaElement.cpp:
1695         (PAL::LogArgument<WebCore::URL>::toString): Logger template for URL that returns the url as a
1696         String when only when the LOG_DISABLED build flag is not defined. Returns "[url]" when it is.
1697         * html/HTMLMediaElement.h:
1698
1699 2017-09-01  Simon Fraser  <simon.fraser@apple.com>
1700
1701         transformCanLikelyUseFastPath() can read off the end of a string
1702         https://bugs.webkit.org/show_bug.cgi?id=176232
1703         rdar://problem/33851237
1704
1705         Reviewed by Tim Horton.
1706         
1707         Code added in r220382 could read one byte past the end of the string when looking for the 'z'
1708         of a rotateZ() function. The code was actually incorrect, testing for the 'z at i+6 after
1709         already incrementing i by 6. This patch makes the code correctly detect rotateZ().
1710         
1711         Also, rotate functions at the end of a string could be ignored because kShortestValidTransformStringLength
1712         was too long, so set it to the length of "rotate(0)", the shortest transform function that we currently
1713         fast-parse.
1714
1715         There's an implicit assumption in this code that chars is not indexed past i+kShortestValidTransformStringLength.
1716         If the 'translate' path is taken, i is incremented by 9 (==kShortestValidTransformStringLength), but that's
1717         OK because WTF::find() doesn't index into chars if i >= length.
1718
1719         Test: fast/css/transform-fast-paths.html
1720
1721         * css/parser/CSSParserFastPaths.cpp:
1722         (WebCore::transformCanLikelyUseFastPath):
1723
1724 2017-09-01  Andy Estes  <aestes@apple.com>
1725
1726         [CG] Upstream CoreGraphics-related WebKitSystemInterface functions
1727         https://bugs.webkit.org/show_bug.cgi?id=176200
1728
1729         Reviewed by Tim Horton.
1730
1731         * platform/graphics/GraphicsContext.h:
1732         * platform/graphics/ImageSource.cpp:
1733         (WebCore::ImageSource::subsamplingLevelForScaleFactor):
1734         * platform/graphics/cg/GraphicsContextCG.cpp:
1735         (WebCore::GraphicsContext::clipOut):
1736         (WebCore::applyShadowOffsetWorkaroundIfNeeded):
1737         * platform/graphics/cg/PatternCG.cpp:
1738         (WebCore::Pattern::createPlatformPattern const):
1739         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
1740         (WebCore::GraphicsContext::focusRingColor):
1741         (WebCore::drawFocusRingAtTime):
1742         (WebCore::drawFocusRing):
1743         (WebCore::drawFocusRingToContext):
1744         (WebCore::drawFocusRingToContextAtTime):
1745         * platform/ios/WebCoreSystemInterfaceIOS.mm:
1746         * platform/mac/PasteboardMac.mm:
1747         (WebCore::flipImageSpec):
1748         (WebCore::setDragImageImpl):
1749         (WebCore::Pasteboard::setDragImage):
1750         * platform/mac/PlatformEventFactoryMac.mm:
1751         * platform/mac/ScrollbarThemeMac.mm:
1752         (WebCore::linenBackgroundColor):
1753         * platform/mac/ThemeMac.mm:
1754         (WebCore::drawCellFocusRingWithFrameAtTime):
1755         (WebCore::drawCellFocusRing):
1756         * platform/mac/WebCoreSystemInterface.h:
1757         * platform/mac/WebCoreSystemInterface.mm:
1758         * platform/mac/WebWindowAnimation.mm:
1759         (flipRect):
1760         (mainWindowServerConnectionID):
1761         (setScaledFrameForWindow):
1762         (-[WebWindowScaleAnimation setCurrentProgress:]):
1763         (-[WebWindowFadeAnimation setCurrentProgress:]):
1764
1765 2017-09-01  Youenn Fablet  <youenn@apple.com>
1766
1767         Reject promises in case of internal CacheStorage engine errors.
1768         https://bugs.webkit.org/show_bug.cgi?id=176194
1769
1770         Reviewed by Alex Christensen.
1771
1772         No new tests as this covers error cases that should not happen in regular cases.
1773         Replacing lambdas that take no parameters to lambdas taking an optional error.
1774         Reject promise if an error is found.
1775
1776         * Modules/cache/Cache.cpp:
1777         (WebCore::Cache::doMatch):
1778         (WebCore::Cache::matchAll):
1779         (WebCore::Cache::keys):
1780         (WebCore::Cache::retrieveRecords):
1781         (WebCore::Cache::queryCache):
1782         * Modules/cache/Cache.h:
1783         * Modules/cache/CacheStorage.cpp:
1784         (WebCore::CacheStorage::match):
1785         (WebCore::CacheStorage::has):
1786         (WebCore::CacheStorage::retrieveCaches):
1787         (WebCore::CacheStorage::open):
1788         (WebCore::CacheStorage::remove):
1789         (WebCore::CacheStorage::keys):
1790         * Modules/cache/CacheStorage.h:
1791
1792 2017-09-01  Zan Dobersek  <zdobersek@igalia.com>
1793
1794         Unreviewed WPE build fix after r221439.
1795
1796         * html/canvas/WebGL2RenderingContext.cpp: Add the HeapInlines.h
1797         header include in order to properly inline a Heap::vm() call.
1798
1799 2017-09-01  Chris Dumez  <cdumez@apple.com>
1800
1801         Implement FileSystemEntry.getParent()
1802         https://bugs.webkit.org/show_bug.cgi?id=176165
1803         <rdar://problem/34187743>
1804
1805         Reviewed by Andreas Kling.
1806
1807         Implement FileSystemEntry.getParent():
1808         - https://wicg.github.io/entries-api/#dom-filesystementry-getparent
1809
1810         Tests: editing/pasteboard/datatransfer-items-drop-getParent-root.html
1811                editing/pasteboard/datatransfer-items-drop-getParent.html
1812                editing/pasteboard/datatransfer-items-drop-getParent2.html
1813
1814         * Modules/entriesapi/DOMFileSystem.cpp:
1815         (WebCore::toFileSystemEntries):
1816         Take a ScriptExecutionContext now that FileSystemEntry is an ActiveDOMObject.
1817
1818         (WebCore::isAbsoluteVirtualPath):
1819         Add utility function to determine if a virtual path is absolute:
1820         - https://wicg.github.io/entries-api/#absolute-path
1821
1822         (WebCore::DOMFileSystem::root):
1823         Take a ScriptExecutionContext now that FileSystemEntry is an ActiveDOMObject.
1824
1825         (WebCore::DOMFileSystem::fileAsEntry):
1826         Take a ScriptExecutionContext now that FileSystemEntry is an ActiveDOMObject.
1827
1828         (WebCore::resolveRelativePath):
1829         Add implementation for:
1830         - https://wicg.github.io/entries-api/#resolve-a-relative-path
1831
1832         (WebCore::DOMFileSystem::listDirectory):
1833         Take a ScriptExecutionContext now that FileSystemEntry is an ActiveDOMObject.
1834
1835         (WebCore::DOMFileSystem::getParent):
1836         Add implementation of getParent() as per:
1837         - https://wicg.github.io/entries-api/#dom-filesystementry-getparent
1838
1839         * Modules/entriesapi/DOMFileSystem.h:
1840         (WebCore::DOMFileSystem::createEntryForFile):
1841         * Modules/entriesapi/DOMFileSystem.idl:
1842         * Modules/entriesapi/FileSystemDirectoryEntry.cpp:
1843         (WebCore::FileSystemDirectoryEntry::FileSystemDirectoryEntry):
1844         * Modules/entriesapi/FileSystemDirectoryEntry.h:
1845         * Modules/entriesapi/FileSystemDirectoryReader.cpp:
1846         (WebCore::FileSystemDirectoryReader::readEntries):
1847         Take a ScriptExecutionContext now that FileSystemEntry is an ActiveDOMObject.
1848
1849         * Modules/entriesapi/FileSystemEntry.cpp:
1850         (WebCore::FileSystemEntry::FileSystemEntry):
1851         (WebCore::FileSystemEntry::activeDOMObjectName const):
1852         (WebCore::FileSystemEntry::canSuspendForDocumentSuspension const):
1853         (WebCore::FileSystemEntry::getParent):
1854         * Modules/entriesapi/FileSystemEntry.h:
1855         * Modules/entriesapi/FileSystemEntry.idl:
1856         - Add implementation of FileSystemEntry.getParent() which relies on
1857           DOMFileSystem::getParent()
1858         - Make FileSystemEntry an ActiveDOMObject as getParent() is an asynchronous
1859           operation which causes delayed JS execution.
1860
1861         * Modules/entriesapi/FileSystemFileEntry.cpp:
1862         (WebCore::FileSystemFileEntry::FileSystemFileEntry):
1863         * Modules/entriesapi/FileSystemFileEntry.h:
1864         * dom/DataTransferItem.cpp:
1865         (WebCore::DataTransferItem::getAsEntry const):
1866         * dom/DataTransferItem.h:
1867         * dom/DataTransferItem.idl:
1868         Take a ScriptExecutionContext now that FileSystemEntry is an ActiveDOMObject.
1869
1870 2017-09-01  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
1871
1872         Ensure RenderStyle and SameSizeAsRenderStyle have the same size
1873         https://bugs.webkit.org/show_bug.cgi?id=176210
1874
1875         Reviewed by Daniel Bates.
1876
1877         SameSizeAsRenderStyle::m_nonInheritedFlags requires a 64 bit alignment,
1878         which currently produces an extra 32 bit padding with 32 bit build.
1879
1880         * rendering/style/RenderStyle.cpp:
1881         Make m_nonInheritedFlags 32 bit aligned and restore the size check.
1882
1883 2017-09-01  Per Arne Vollan  <pvollan@apple.com>
1884
1885         [Win] Compile error, 'Cache' is not declared.
1886         https://bugs.webkit.org/show_bug.cgi?id=176062
1887
1888         Reviewed by Youenn Fablet.
1889
1890         Rename DOMCache to DOMCacheEngine.
1891
1892         No new tests, covered by existing tests. 
1893
1894         * Modules/cache/Cache.cpp:
1895         (WebCore::Cache::addAll):
1896         (WebCore::Cache::put):
1897         (WebCore::queryCacheMatch):
1898         (WebCore::Cache::batchDeleteOperation):
1899         (WebCore::toConnectionRecord):
1900         (WebCore::Cache::batchPutOperation):
1901         * Modules/cache/Cache.h:
1902         * Modules/cache/CacheStorage.cpp:
1903         (WebCore::CacheStorage::open):
1904         (WebCore::CacheStorage::remove):
1905         * Modules/cache/CacheStorageConnection.cpp:
1906         * Modules/cache/CacheStorageConnection.h:
1907         (WebCore::CacheStorageConnection::clearMemoryRepresentation):
1908         (WebCore::CacheStorageConnection::openCompleted):
1909         (WebCore::CacheStorageConnection::removeCompleted):
1910         (WebCore::CacheStorageConnection::doOpen):
1911         (WebCore::CacheStorageConnection::doRemove):
1912         (WebCore::CacheStorageConnection::doBatchDeleteOperation):
1913         (WebCore::CacheStorageConnection::doBatchPutOperation):
1914         * Modules/cache/DOMCache.cpp: Removed.
1915         * Modules/cache/DOMCache.h: Removed.
1916         * Modules/cache/DOMCacheEngine.cpp: Copied from Source/WebCore/Modules/cache/DOMCache.cpp.
1917         (WebCore::DOMCacheEngine::isolatedResponseBody):
1918         (WebCore::DOMCacheEngine::copyResponseBody):
1919         (WebCore::DOMCache::errorToException): Deleted.
1920         (WebCore::DOMCache::queryCacheMatch): Deleted.
1921         (WebCore::DOMCache::isolatedResponseBody): Deleted.
1922         (WebCore::DOMCache::copyResponseBody): Deleted.
1923         (WebCore::DOMCache::Record::copy const): Deleted.
1924         * Modules/cache/DOMCacheEngine.h: Copied from Source/WebCore/Modules/cache/DOMCache.h.
1925         * Modules/cache/WorkerCacheStorageConnection.cpp:
1926         * Modules/cache/WorkerCacheStorageConnection.h:
1927         * WebCore.xcodeproj/project.pbxproj:
1928         * testing/Internals.cpp:
1929         (WebCore::Internals::clearCacheStorageMemoryRepresentation):
1930
1931 2017-08-31  Andy Estes  <aestes@apple.com>
1932
1933         [Mac] Upstream AppKit-related WebKitSystemInterface functions
1934         https://bugs.webkit.org/show_bug.cgi?id=176175
1935
1936         Reviewed by Brady Eidson.
1937
1938         * Configurations/WebCore.xcconfig: Added -ObjC to OTHER_LDFLAGS so that Objective-C classes
1939         in PAL are exported by WebCore even if WebCore doesn't use them.
1940         * platform/mac/PlatformEventFactoryMac.h:
1941         * platform/mac/PlatformEventFactoryMac.mm:
1942         (WebCore::getWheelEventDeltas):
1943         (WebCore::keyCharForEvent):
1944         (WebCore::PlatformWheelEventBuilder::PlatformWheelEventBuilder):
1945         * platform/mac/WebCoreSystemInterface.h:
1946         * platform/mac/WebCoreSystemInterface.mm:
1947
1948 2017-08-31  Alex Christensen  <achristensen@webkit.org>
1949
1950         Fix Windows build after r221422
1951         https://bugs.webkit.org/show_bug.cgi?id=174924
1952
1953         * platform/text/win/LocaleWin.cpp:
1954         (WebCore::LocaleWin::getLocaleInfoString):
1955         StringVector is now the type that can be adopted by String::adopt.
1956
1957 2017-08-31  Daniel Bates  <dabates@apple.com>
1958
1959         Another attempt to fix the Apple Windows build following <https://trac.webkit.org/changeset/221459>
1960         (https://bugs.webkit.org/show_bug.cgi?id=176171)
1961
1962         Temporarily weaken the size check for RenderStyle from a strict equality to <=.
1963
1964         * rendering/style/RenderStyle.cpp:
1965
1966 2017-08-31  Daniel Bates  <dabates@apple.com>
1967
1968         Attempt to fix the Apple Windows and WinCairo build following <https://trac.webkit.org/changeset/221459>
1969         (https://bugs.webkit.org/show_bug.cgi?id=176171)
1970
1971         Explicitly cast PseudoIds to unsigned before computing a difference between two PseudoIds.
1972
1973         * rendering/style/RenderStyle.h:
1974
1975 2017-08-31  Alex Christensen  <achristensen@webkit.org>
1976
1977         Add ObjC SPI corresponding to WKPageLoaderClient's webGLLoadPolicy and resolveWebGLLoadPolicy
1978         https://bugs.webkit.org/show_bug.cgi?id=175779
1979         <rdar://problem/22367975>
1980
1981         Reviewed by Tim Horton.
1982
1983         Covered by new API tests.
1984
1985         * loader/FrameLoaderClient.h:
1986
1987 2017-08-31  Andreas Kling  <akling@apple.com>
1988
1989         Element focus appearance update should be either immediate or a post-layout task
1990         https://bugs.webkit.org/show_bug.cgi?id=176193
1991
1992         Reviewed by Antti Koivisto.
1993
1994         This change removes an old mechanism for avoiding element focus appearance updates
1995         while we might be in the middle of attaching a renderer.
1996
1997         Focus appearance updates depend on a clean layout, since they want to be able to
1998         scroll the element into the visible viewport if needed.
1999         We now simply do the updates either immediately after layout in Element::focus(),
2000         or as a post-layout callback when needed for HTMLInputElement::didAttachRenderers().
2001
2002         * dom/Document.cpp:
2003         (WebCore::Document::Document):
2004         (WebCore::Document::updateFocusAppearanceSoon): Deleted.
2005         (WebCore::Document::cancelFocusAppearanceUpdate): Deleted.
2006         (WebCore::Document::updateFocusAppearanceTimerFired): Deleted.
2007         * dom/Document.h:
2008         * dom/Element.cpp:
2009         (WebCore::Element::focus):
2010         (WebCore::Element::blur):
2011         (WebCore::Element::clearStyleDerivedDataBeforeDetachingRenderer):
2012         (WebCore::Element::updateFocusAppearanceAfterAttachIfNeeded): Deleted.
2013         (WebCore::Element::cancelFocusAppearanceUpdate): Deleted.
2014         * dom/Element.h:
2015         * dom/ElementRareData.h:
2016         (WebCore::ElementRareData::ElementRareData):
2017         (WebCore::ElementRareData::needsFocusAppearanceUpdateSoonAfterAttach const): Deleted.
2018         (WebCore::ElementRareData::setNeedsFocusAppearanceUpdateSoonAfterAttach): Deleted.
2019         * html/HTMLInputElement.cpp:
2020         (WebCore::HTMLInputElement::didAttachRenderers):
2021
2022 2017-08-31  Don Olmstead  <don.olmstead@sony.com>
2023
2024         [CMake] Make USE_CF conditional within Windows
2025         https://bugs.webkit.org/show_bug.cgi?id=176173
2026
2027         Reviewed by Alex Christensen.
2028
2029         No new tests. No change in behavior.
2030
2031         * PlatformWin.cmake:
2032         * WebCorePrefix.h:
2033         * testing/js/WebCoreTestSupportPrefix.h:
2034
2035 2017-08-31  Sam Weinig  <sam@webkit.org>
2036
2037         Implement DOMMatrix2DInit for setTransform()/addPath()
2038         https://bugs.webkit.org/show_bug.cgi?id=176048
2039
2040         Reviewed by Simon Fraser.
2041
2042         * DerivedSources.make:
2043         * WebCore.xcodeproj/project.pbxproj:
2044         * CMakeLists.txt:
2045
2046             Add new files.
2047
2048         * bindings/js/CallTracerTypes.h:
2049         * inspector/InspectorCanvas.cpp:
2050         
2051             Swap out DOMMatrixInit for DOMMatrix2DInit in canvas tracing infrastructure.
2052
2053         * css/DOMMatrix2DInit.h: Added.
2054         * css/DOMMatrix2DInit.idl: Added.
2055         * css/DOMMatrixInit.h:
2056         * css/DOMMatrixInit.idl:
2057         Split DOMMatrixInit in two, with the 2D bits going into DOMMatrix2DInit.
2058         
2059         * css/DOMMatrixReadOnly.cpp:
2060         * css/DOMMatrixReadOnly.h:
2061         
2062             Add a validateAndFixup overload for DOMMatrix2DInit.
2063         
2064         * html/canvas/CanvasRenderingContext2D.cpp:
2065         * html/canvas/CanvasRenderingContext2D.h:
2066
2067             Swap out DOMMatrixInit for DOMMatrix2DInit in setTransform. This
2068             should have no observable difference, since we ignored the 3D prior.
2069
2070         * html/canvas/DOMPath.cpp:
2071         * html/canvas/DOMPath.h:
2072         * html/canvas/DOMPath.idl:
2073
2074             Update DOMPath (actually called Path2D) to take an optional DOMMatrix2DInit
2075             rather than an SVGMatrix. Passing an SVGMatrix is still valid, as it conforms
2076             as a DOMMatrix2DInit dictionary (having the necessary properties), so the
2077             risk of compatibility issues is minimal.
2078
2079 2017-08-31  Brady Eidson  <beidson@apple.com>
2080
2081         Add (entirely incorrect) fetching of ServiceWorker scripts.
2082         https://bugs.webkit.org/show_bug.cgi?id=176179
2083
2084         Reviewed by Andy Estes.
2085
2086         No new tests (Covered by changes to existing tests).
2087
2088         When the Storage process is running the "Update" algorithm and a ServiceWorker script file needs to be fetched, this patch:
2089           - Messages back to the WebContent process that started the register/update job
2090           - Executes a FetchLoad in that script context for the script
2091           - Sends the results back to the Storage process
2092
2093         We don't do anything with the results yet.
2094
2095         Soon.
2096
2097         * WebCore.xcodeproj/project.pbxproj:
2098
2099         * workers/service/ServiceWorkerContainer.cpp:
2100         (WebCore::ServiceWorkerContainer::startScriptFetchForJob):
2101         (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
2102         (WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
2103         * workers/service/ServiceWorkerContainer.h:
2104
2105         * workers/service/ServiceWorkerFetchResult.h: Copied from Source/WebCore/workers/service/server/SWClientConnection.h.
2106         (WebCore::ServiceWorkerFetchResult::encode const):
2107         (WebCore::ServiceWorkerFetchResult::decode):
2108
2109         * workers/service/ServiceWorkerJob.cpp:
2110         (WebCore::ServiceWorkerJob::startScriptFetch):
2111         (WebCore::ServiceWorkerJob::fetchScriptWithContext):
2112         (WebCore::ServiceWorkerJob::didReceiveResponse):
2113         (WebCore::ServiceWorkerJob::didReceiveData):
2114         (WebCore::ServiceWorkerJob::didSucceed):
2115         (WebCore::ServiceWorkerJob::didFail):
2116         * workers/service/ServiceWorkerJob.h:
2117
2118         * workers/service/ServiceWorkerJobClient.h:
2119
2120         * workers/service/server/SWClientConnection.cpp:
2121         (WebCore::SWClientConnection::finishedFetchingScript):
2122         (WebCore::SWClientConnection::failedFetchingScript):
2123         (WebCore::SWClientConnection::startScriptFetchForServer):
2124         * workers/service/server/SWClientConnection.h:
2125
2126         * workers/service/server/SWServer.cpp:
2127         (WebCore::SWServer::Connection::finishFetchingScriptInServer):
2128         (WebCore::SWServer::startScriptFetch):
2129         (WebCore::SWServer::scriptFetchFinished):
2130         * workers/service/server/SWServer.h:
2131
2132         * workers/service/server/SWServerRegistration.cpp:
2133         (WebCore::SWServerRegistration::scriptFetchFinished):
2134         (WebCore::SWServerRegistration::runUpdateJob):
2135         (WebCore::SWServerRegistration::startScriptFetchFromMainThread):
2136         (WebCore::SWServerRegistration::startScriptFetchForCurrentJob):
2137         * workers/service/server/SWServerRegistration.h:
2138
2139 2017-08-31  Daniel Bates  <dabates@apple.com>
2140
2141         Make RenderStyle's non-inherited flags more human friendly
2142         https://bugs.webkit.org/show_bug.cgi?id=176171
2143
2144         Reviewed by Antti Koivisto.
2145
2146         Revert r166465 as we never followed through and made the CSS JIT update
2147         RenderStyle's non-inherited flags directly.
2148
2149         * rendering/style/RenderStyle.cpp:
2150         (WebCore::RenderStyle::RenderStyle):
2151         (WebCore::RenderStyle::hashForTextAutosizing const):
2152         (WebCore::RenderStyle::equalForTextAutosizing const):
2153         (WebCore::RenderStyle::changeRequiresLayout const):
2154         * rendering/style/RenderStyle.h:
2155         (WebCore::RenderStyle::styleType const):
2156         (WebCore::RenderStyle::setStyleType):
2157         (WebCore::RenderStyle::setHasViewportUnits):
2158         (WebCore::RenderStyle::hasViewportUnits const):
2159         (WebCore::RenderStyle::affectedByHover const):
2160         (WebCore::RenderStyle::affectedByActive const):
2161         (WebCore::RenderStyle::affectedByDrag const):
2162         (WebCore::RenderStyle::setAffectedByHover):
2163         (WebCore::RenderStyle::setAffectedByActive):
2164         (WebCore::RenderStyle::setAffectedByDrag):
2165         (WebCore::RenderStyle::isFloating const):
2166         (WebCore::RenderStyle::display const):
2167         (WebCore::RenderStyle::position const):
2168         (WebCore::RenderStyle::floating const):
2169         (WebCore::RenderStyle::overflowX const):
2170         (WebCore::RenderStyle::overflowY const):
2171         (WebCore::RenderStyle::verticalAlign const):
2172         (WebCore::RenderStyle::unicodeBidi const):
2173         (WebCore::RenderStyle::clear const):
2174         (WebCore::RenderStyle::tableLayout const):
2175         (WebCore::RenderStyle::hasExplicitlySetDirection const):
2176         (WebCore::RenderStyle::isLink const):
2177         (WebCore::RenderStyle::setDisplay):
2178         (WebCore::RenderStyle::setOriginalDisplay):
2179         (WebCore::RenderStyle::setPosition):
2180         (WebCore::RenderStyle::setFloating):
2181         (WebCore::RenderStyle::setOverflowX):
2182         (WebCore::RenderStyle::setOverflowY):
2183         (WebCore::RenderStyle::setVerticalAlign):
2184         (WebCore::RenderStyle::setUnicodeBidi):
2185         (WebCore::RenderStyle::setClear):
2186         (WebCore::RenderStyle::setTableLayout):
2187         (WebCore::RenderStyle::setHasExplicitlySetDirection):
2188         (WebCore::RenderStyle::setIsLink):
2189         (WebCore::RenderStyle::hasExplicitlySetWritingMode const):
2190         (WebCore::RenderStyle::setHasExplicitlySetWritingMode):
2191         (WebCore::RenderStyle::hasExplicitlySetTextAlign const):
2192         (WebCore::RenderStyle::setHasExplicitlySetTextAlign):
2193         (WebCore::RenderStyle::unique const):
2194         (WebCore::RenderStyle::setUnique):
2195         (WebCore::RenderStyle::emptyState const):
2196         (WebCore::RenderStyle::setEmptyState):
2197         (WebCore::RenderStyle::firstChildState const):
2198         (WebCore::RenderStyle::setFirstChildState):
2199         (WebCore::RenderStyle::lastChildState const):
2200         (WebCore::RenderStyle::setLastChildState):
2201         (WebCore::RenderStyle::setHasExplicitlyInheritedProperties):
2202         (WebCore::RenderStyle::hasExplicitlyInheritedProperties const):
2203         (WebCore::RenderStyle::inheritUnicodeBidiFrom):
2204         (WebCore::RenderStyle::NonInheritedFlags::operator!= const):
2205         (WebCore::RenderStyle::NonInheritedFlags::hasAnyPublicPseudoStyles const):
2206         (WebCore::RenderStyle::originalDisplay const):
2207         (WebCore::RenderStyle::NonInheritedFlags::operator== const):
2208         (WebCore::RenderStyle::NonInheritedFlags::copyNonInheritedFrom):
2209         (WebCore::RenderStyle::NonInheritedFlags::hasPseudoStyle const):
2210         (WebCore::RenderStyle::NonInheritedFlags::setHasPseudoStyle):
2211         (WebCore::RenderStyle::NonInheritedFlags::overflowX const): Deleted.
2212         (WebCore::RenderStyle::NonInheritedFlags::setOverflowX): Deleted.
2213         (WebCore::RenderStyle::NonInheritedFlags::overflowY const): Deleted.
2214         (WebCore::RenderStyle::NonInheritedFlags::setOverflowY): Deleted.
2215         (WebCore::RenderStyle::NonInheritedFlags::clear const): Deleted.
2216         (WebCore::RenderStyle::NonInheritedFlags::setClear): Deleted.
2217         (WebCore::RenderStyle::NonInheritedFlags::effectiveDisplay const): Deleted.
2218         (WebCore::RenderStyle::NonInheritedFlags::setEffectiveDisplay): Deleted.
2219         (WebCore::RenderStyle::NonInheritedFlags::position const): Deleted.
2220         (WebCore::RenderStyle::NonInheritedFlags::setPosition): Deleted.
2221         (WebCore::RenderStyle::NonInheritedFlags::originalDisplay const): Deleted.
2222         (WebCore::RenderStyle::NonInheritedFlags::setOriginalDisplay): Deleted.
2223         (WebCore::RenderStyle::NonInheritedFlags::unicodeBidi const): Deleted.
2224         (WebCore::RenderStyle::NonInheritedFlags::setUnicodeBidi): Deleted.
2225         (WebCore::RenderStyle::NonInheritedFlags::hasViewportUnits const): Deleted.
2226         (WebCore::RenderStyle::NonInheritedFlags::setHasViewportUnits): Deleted.
2227         (WebCore::RenderStyle::NonInheritedFlags::verticalAlign const): Deleted.
2228         (WebCore::RenderStyle::NonInheritedFlags::setVerticalAlign): Deleted.
2229         (WebCore::RenderStyle::NonInheritedFlags::hasExplicitlyInheritedProperties const): Deleted.
2230         (WebCore::RenderStyle::NonInheritedFlags::setHasExplicitlyInheritedProperties): Deleted.
2231         (WebCore::RenderStyle::NonInheritedFlags::isFloating const): Deleted.
2232         (WebCore::RenderStyle::NonInheritedFlags::floating const): Deleted.
2233         (WebCore::RenderStyle::NonInheritedFlags::setFloating): Deleted.
2234         (WebCore::RenderStyle::NonInheritedFlags::tableLayout const): Deleted.
2235         (WebCore::RenderStyle::NonInheritedFlags::setTableLayout): Deleted.
2236         (WebCore::RenderStyle::NonInheritedFlags::styleType const): Deleted.
2237         (WebCore::RenderStyle::NonInheritedFlags::setStyleType): Deleted.
2238         (WebCore::RenderStyle::NonInheritedFlags::isUnique const): Deleted.
2239         (WebCore::RenderStyle::NonInheritedFlags::setIsUnique): Deleted.
2240         (WebCore::RenderStyle::NonInheritedFlags::emptyState const): Deleted.
2241         (WebCore::RenderStyle::NonInheritedFlags::setEmptyState): Deleted.
2242         (WebCore::RenderStyle::NonInheritedFlags::firstChildState const): Deleted.
2243         (WebCore::RenderStyle::NonInheritedFlags::setFirstChildState): Deleted.
2244         (WebCore::RenderStyle::NonInheritedFlags::lastChildState const): Deleted.
2245         (WebCore::RenderStyle::NonInheritedFlags::setLastChildState): Deleted.
2246         (WebCore::RenderStyle::NonInheritedFlags::affectedByHover const): Deleted.
2247         (WebCore::RenderStyle::NonInheritedFlags::setAffectedByHover): Deleted.
2248         (WebCore::RenderStyle::NonInheritedFlags::affectedByActive const): Deleted.
2249         (WebCore::RenderStyle::NonInheritedFlags::setAffectedByActive): Deleted.
2250         (WebCore::RenderStyle::NonInheritedFlags::affectedByDrag const): Deleted.
2251         (WebCore::RenderStyle::NonInheritedFlags::setAffectedByDrag): Deleted.
2252         (WebCore::RenderStyle::NonInheritedFlags::isLink const): Deleted.
2253         (WebCore::RenderStyle::NonInheritedFlags::setIsLink): Deleted.
2254         (WebCore::RenderStyle::NonInheritedFlags::hasExplicitlySetDirection const): Deleted.
2255         (WebCore::RenderStyle::NonInheritedFlags::setHasExplicitlySetDirection): Deleted.
2256         (WebCore::RenderStyle::NonInheritedFlags::hasExplicitlySetWritingMode const): Deleted.
2257         (WebCore::RenderStyle::NonInheritedFlags::setHasExplicitlySetWritingMode): Deleted.
2258         (WebCore::RenderStyle::NonInheritedFlags::hasExplicitlySetTextAlign const): Deleted.
2259         (WebCore::RenderStyle::NonInheritedFlags::setHasExplicitlySetTextAlign): Deleted.
2260         (WebCore::RenderStyle::NonInheritedFlags::flagsMemoryOffset): Deleted.
2261         (WebCore::RenderStyle::NonInheritedFlags::flagIsaffectedByActive): Deleted.
2262         (WebCore::RenderStyle::NonInheritedFlags::flagIsaffectedByHover): Deleted.
2263         (WebCore::RenderStyle::NonInheritedFlags::flagPseudoStyle): Deleted.
2264         (WebCore::RenderStyle::NonInheritedFlags::setFirstChildStateFlags): Deleted.
2265         (WebCore::RenderStyle::NonInheritedFlags::setLastChildStateFlags): Deleted.
2266         (WebCore::RenderStyle::NonInheritedFlags::flagIsUnique): Deleted.
2267         (WebCore::RenderStyle::NonInheritedFlags::flagFirstChildState): Deleted.
2268         (WebCore::RenderStyle::NonInheritedFlags::flagLastChildState): Deleted.
2269         (WebCore::RenderStyle::NonInheritedFlags::NonInheritedFlags): Deleted.
2270         (WebCore::RenderStyle::NonInheritedFlags::setHasPseudoStyles): Deleted.
2271         (WebCore::RenderStyle::NonInheritedFlags::updateBoolean): Deleted.
2272         (WebCore::RenderStyle::NonInheritedFlags::getBoolean const): Deleted.
2273         (WebCore::RenderStyle::NonInheritedFlags::updateValue): Deleted.
2274         (WebCore::RenderStyle::InheritedFlags::operator== const): Deleted.
2275         (WebCore::RenderStyle::NonInheritedFlags::getValue const): Deleted.
2276         (WebCore::adjustForAbsoluteZoom): Deleted.
2277         (WebCore::adjustFloatForAbsoluteZoom): Deleted.
2278         (WebCore::adjustLayoutUnitForAbsoluteZoom): Deleted.
2279         (WebCore::collapsedBorderStyle): Deleted.
2280         (WebCore::RenderStyle::hasBackground const): Deleted.
2281         (WebCore::RenderStyle::autoWrap): Deleted.
2282         (WebCore::RenderStyle::preserveNewline): Deleted.
2283         (WebCore::RenderStyle::collapseWhiteSpace): Deleted.
2284         (WebCore::RenderStyle::isCollapsibleWhiteSpace const): Deleted.
2285         (WebCore::RenderStyle::breakOnlyAfterWhiteSpace const): Deleted.
2286         (WebCore::RenderStyle::breakWords const): Deleted.
2287         (WebCore::RenderStyle::hasInlineColumnAxis const): Deleted.
2288         (WebCore::RenderStyle::imageOrientation const): Deleted.
2289         (WebCore::RenderStyle::setLogicalWidth): Deleted.
2290         (WebCore::RenderStyle::setLogicalHeight): Deleted.
2291         (WebCore::RenderStyle::setBorderRadius): Deleted.
2292         (WebCore::RenderStyle::setZoom): Deleted.
2293         (WebCore::RenderStyle::setEffectiveZoom): Deleted.
2294         (WebCore::RenderStyle::setTextOrientation): Deleted.
2295         (WebCore::RenderStyle::adjustBackgroundLayers): Deleted.
2296         (WebCore::RenderStyle::adjustMaskLayers): Deleted.
2297         (WebCore::RenderStyle::clearAnimations): Deleted.
2298         (WebCore::RenderStyle::clearTransitions): Deleted.
2299         (WebCore::RenderStyle::setShapeOutside): Deleted.
2300         (WebCore::RenderStyle::setShapeImageThreshold): Deleted.
2301         (WebCore::RenderStyle::setClipPath): Deleted.
2302         (WebCore::RenderStyle::willChangeCreatesStackingContext const): Deleted.
2303         (WebCore::RenderStyle::isDisplayRegionType const): Deleted.
2304         (WebCore::RenderStyle::setWritingMode): Deleted.
2305         (WebCore::RenderStyle::getShadowInlineDirectionExtent const): Deleted.
2306         (WebCore::RenderStyle::getShadowBlockDirectionExtent const): Deleted.
2307         (WebCore::RenderStyle::isDisplayReplacedType): Deleted.
2308         (WebCore::RenderStyle::isDisplayInlineType): Deleted.
2309         (WebCore::RenderStyle::isDisplayFlexibleBox): Deleted.
2310         (WebCore::RenderStyle::isDisplayGridBox): Deleted.
2311         (WebCore::RenderStyle::isDisplayFlexibleOrGridBox): Deleted.
2312         (WebCore::RenderStyle::hasAnyPublicPseudoStyles const): Deleted.
2313         (WebCore::RenderStyle::hasPseudoStyle const): Deleted.
2314         (WebCore::RenderStyle::setHasPseudoStyle): Deleted.
2315         (WebCore::RenderStyle::setHasPseudoStyles): Deleted.
2316         (WebCore::RenderStyle::setBoxReflect): Deleted.
2317         (WebCore::pseudoElementRendererIsNeeded): Deleted.
2318
2319 2017-08-31  Antti Koivisto  <antti@apple.com>
2320
2321         Remove newBlockInsideInlineModel and anonymous inline block
2322         https://bugs.webkit.org/show_bug.cgi?id=176181
2323
2324         Reviewed by Zalan Bujtas.
2325
2326         Anonymous inline block exists to support newBlockInsideInlineModel which was planned as the replacement for continuations.
2327         It has never been enabled and it is time to remove it.
2328
2329         * page/Settings.in:
2330         * rendering/InlineElementBox.cpp:
2331         (WebCore::InlineElementBox::paint):
2332         (WebCore::InlineElementBox::nodeAtPoint):
2333         * rendering/InlineFlowBox.cpp:
2334         (WebCore::InlineFlowBox::addToLine):
2335         (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
2336         (WebCore::InlineFlowBox::nodeAtPoint):
2337         (WebCore::InlineFlowBox::paint):
2338         (WebCore::InlineFlowBox::anonymousInlineBlock const): Deleted.
2339         * rendering/InlineFlowBox.h:
2340         (WebCore::InlineFlowBox::InlineFlowBox):
2341         (WebCore::InlineFlowBox::hasAnonymousInlineBlock const): Deleted.
2342         (WebCore::InlineFlowBox::setHasAnonymousInlineBlock): Deleted.
2343         * rendering/RenderBlock.cpp:
2344         (WebCore::RenderBlock::lineHeight const):
2345         (WebCore::RenderBlock::baselinePosition const):
2346         (WebCore::RenderBlock::renderName const):
2347         * rendering/RenderBlockFlow.cpp:
2348         (WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats):
2349         (WebCore::RenderBlockFlow::childrenPreventSelfCollapsing const):
2350         (WebCore::RenderBlockFlow::adjustLinePositionForPagination):
2351         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
2352         * rendering/RenderBlockFlow.h:
2353         * rendering/RenderBlockLineLayout.cpp:
2354         (WebCore::updateLogicalInlinePositions):
2355         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForLine):
2356         (WebCore::RenderBlockFlow::layoutRunsAndFloats):
2357         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
2358         (WebCore::RenderBlockFlow::layoutLineBoxes):
2359         (WebCore::RenderBlockFlow::determineStartPosition):
2360         (WebCore::RenderBlockFlow::matchedEndLine):
2361         (WebCore::RenderBlockFlow::marginCollapseLinesFromStart): Deleted.
2362         * rendering/RenderBox.cpp:
2363         (WebCore::RenderBox::sizesLogicalWidthToFitContent const):
2364         (WebCore::RenderBox::createsNewFormattingContext const):
2365         (WebCore::RenderBox::avoidsFloats const):
2366         * rendering/RenderInline.cpp:
2367         (WebCore::RenderInline::addChildIgnoringContinuation):
2368         * rendering/RenderObject.cpp:
2369         (WebCore::RenderObject::isAnonymousInlineBlock const): Deleted.
2370         * rendering/RenderObject.h:
2371         (WebCore::RenderObject::isAnonymousBlock const):
2372         * rendering/RootInlineBox.cpp:
2373         (WebCore::RootInlineBox::alignBoxesInBlockDirection):
2374         (WebCore::RootInlineBox::ascentAndDescentForBox const):
2375         * rendering/line/BreakingContext.h:
2376         (WebCore::BreakingContext::BreakingContext):
2377         (WebCore::BreakingContext::handleReplaced):
2378         * rendering/line/LineBreaker.cpp:
2379         (WebCore::LineBreaker::nextLineBreak):
2380         * rendering/line/LineBreaker.h:
2381         * rendering/line/LineLayoutState.h:
2382         (WebCore::LineLayoutState::marginInfo):
2383         (WebCore::LineLayoutState::prevFloatBottomFromAnonymousInlineBlock): Deleted.
2384         (WebCore::LineLayoutState::maxFloatBottomFromAnonymousInlineBlock): Deleted.
2385
2386 2017-08-31  Ryan Haddad  <ryanhaddad@apple.com>
2387
2388         Unreviewed, rolling out r221445.
2389
2390         This change broke Sierra Release builds.
2391
2392         Reverted changeset:
2393
2394         "Switch HTMLMediaElement to release logging"
2395         https://bugs.webkit.org/show_bug.cgi?id=176065
2396         http://trac.webkit.org/changeset/221445
2397
2398 2017-08-31  Youenn Fablet  <youenn@apple.com>
2399
2400         Update CacheStorage caches only if it is updated
2401         https://bugs.webkit.org/show_bug.cgi?id=176135
2402
2403         Reviewed by Alex Christensen.
2404
2405         Covered by existing tests.
2406
2407         When retrieving caches from the engine, CacheStorage gets an update counter.
2408         When this counter is different from the previous received one, CacheStorage will update its cache list.
2409         Otherwise it will skip this update step.
2410
2411         * Modules/cache/CacheStorage.cpp:
2412         (WebCore::CacheStorage::retrieveCaches):
2413         * Modules/cache/CacheStorage.h:
2414         * Modules/cache/CacheStorageConnection.cpp:
2415         (WebCore::CacheStorageConnection::retrieveCaches):
2416         * Modules/cache/CacheStorageConnection.h:
2417         (WebCore::CacheStorageConnection::doRetrieveCaches):
2418         * Modules/cache/DOMCache.cpp:
2419         (WebCore::DOMCache::CacheInfos::isolatedCopy):
2420         * Modules/cache/DOMCache.h:
2421         (WebCore::DOMCache::CacheInfos::encode const):
2422         (WebCore::DOMCache::CacheInfos::decode):
2423         * Modules/cache/WorkerCacheStorageConnection.cpp:
2424         (WebCore::WorkerCacheStorageConnection::doRetrieveCaches):
2425         * Modules/cache/WorkerCacheStorageConnection.h:
2426
2427 2017-08-31  Eric Carlson  <eric.carlson@apple.com>
2428
2429         Switch HTMLMediaElement to release logging
2430         https://bugs.webkit.org/show_bug.cgi?id=176065
2431
2432         Reviewed by Jer Noble.
2433
2434         * dom/Document.cpp:
2435         (WebCore::Document::privateBrowsingStateDidChange): Disable the logger when private browsing
2436         mode is enabled.
2437         (WebCore::Document::logger const):
2438         * dom/Document.h:
2439
2440         Convert debug-only logging to configurable release logging.
2441         * html/HTMLMediaElement.cpp:
2442         (PAL::LogArgument<WebCore::URL>::toString): Logger template for URL that returns the url as a
2443         String when only when the LOG_DISABLED build flag is not defined. Returns "[url]" when it is.
2444         * html/HTMLMediaElement.h:
2445
2446 2017-08-31  David Quesada  <david_quesada@apple.com>
2447
2448         WKNavigationDelegatePrivate client redirect SPI needs to be able to detect redirects scheduled before the document finishes loading
2449         https://bugs.webkit.org/show_bug.cgi?id=176128
2450         rdar://problem/34068476
2451
2452         Reviewed by Brady Eidson.
2453
2454         Removed FrameLoaderClient::dispatchDidPerformClientRedirect() since no client cares about this event anymore.
2455         Also removed FrameLoader::performClientRedirect() since it wouldn't do anything but call changeLocation().
2456
2457         No new tests - no change in functionality.
2458
2459         * loader/FrameLoader.cpp:
2460         * loader/FrameLoader.h:
2461         * loader/FrameLoaderClient.h:
2462         * loader/NavigationScheduler.cpp:
2463
2464 2017-08-31  Chris Dumez  <cdumez@apple.com>
2465
2466         getFileMetadata() does not work as expected for symbolic links
2467         https://bugs.webkit.org/show_bug.cgi?id=176143
2468
2469         Reviewed by Andreas Kling.
2470
2471         getFileMetadata() does not work as expected for symbolic links:
2472         On POSIX, getFileMetadata() always followed symlinks, which meant that FileMetadata.type could
2473         never be TypeSymbolicLink. On Windows, the function properly did not follow symlinks but failed to set
2474         FileMetadata.type to TypeSymbolicLink when the file was a symbolic link.
2475
2476         This patch adds a new ShouldFollowSymbolicLinks parameter to getFileMetadata() so that
2477         the call site can decide the behavior it wants. If getFileMetadata() is called on a
2478         symbolic link with ShouldFollowSymbolicLinks::No as parameter, FileMetadata.type is now
2479         properly set to TypeSymbolicLink.
2480
2481         No new tests, covered by new API test.
2482
2483         * Modules/entriesapi/DOMFileSystem.cpp:
2484         (WebCore::listDirectoryWithMetadata):
2485         It is important we do not follow symlinks here since the code wants to discard them
2486         and does so by checking FileMetadata.type.
2487
2488         * WebCore.xcodeproj/project.pbxproj:
2489         * fileapi/File.cpp:
2490         (WebCore::File::isDirectory const):
2491
2492         * html/FileListCreator.cpp:
2493         (WebCore::appendDirectoryFiles):
2494         (WebCore::FileListCreator::createFileList):
2495         It is important we do not follow symlinks here since the code wants to discard them
2496         and does so by checking FileMetadata.type.
2497
2498         * platform/FileSystem.cpp:
2499         (WebCore::fileIsDirectory):
2500         * platform/FileSystem.h:
2501         * platform/glib/FileSystemGlib.cpp:
2502         (WebCore::getFileLStat):
2503         (WebCore::getFileMetadata):
2504         * platform/posix/FileSystemPOSIX.cpp:
2505         (WebCore::getFileMetadata):
2506         (WebCore::createSymbolicLink):
2507         * platform/win/FileSystemWin.cpp:
2508         (WebCore::getFinalPathName):
2509         (WebCore::getFileMetadata):
2510         (WebCore::createSymbolicLink):
2511         - Add new createSymbolicLink() function for testing purposes.
2512         - On Posix, call lstat() instead of stat if ShouldFollowSymbolicLinks::No.
2513         - On Windows, since FindFirstFileW() does not follow symlinks, resolve
2514           final path using GetFinalPathNameByHandleW() if ShouldFollowSymbolicLinks::Yes.
2515         - On Windows, properly set FileMetadata.type to TypeSymbolicLink if the file
2516           is a symbolic link.
2517
2518 2017-08-31  Michael Catanzaro  <mcatanzaro@igalia.com>
2519
2520         REGRESSION(r221226): [SOUP] libsoup-CRITICAL **: soup_cookies_to_cookie_header: assertion 'cookies != NULL' failed
2521         https://bugs.webkit.org/show_bug.cgi?id=176140
2522
2523         Reviewed by Carlos Garcia Campos.
2524
2525         This should fix unexpected stderr output in several tests.
2526
2527         * platform/network/soup/CookieJarSoup.cpp:
2528         (WebCore::cookiesForSession):
2529
2530 2017-08-31  Youenn Fablet  <youenn@apple.com>
2531
2532         Add support for Request body stream cloning
2533         https://bugs.webkit.org/show_bug.cgi?id=176148
2534
2535         Reviewed by Alex Christensen.
2536
2537         Tests: http/wpt/fetch/request-clone.html
2538                http/wpt/fetch/request-consume-stream.html
2539                http/wpt/fetch/request-stream-disturbed-1.html
2540                http/wpt/fetch/request-stream-disturbed-2.html
2541                http/wpt/fetch/request-stream-disturbed-3.html
2542
2543         Adding support for ReadableStream teeing for cloning fetch bodies.
2544         Adding support for pushing request body data to its ReadableStream.
2545         Renamed FetchResponseSource to FetchBodySource for that purpose.
2546
2547         Tests extracting body from a ReadableStream through JS API pass.
2548         Tests extracting data stored in a ReadableStream to resolve fetch body promises are failing.
2549         There is no support yet, this will be added as a follow-up.
2550
2551         * CMakeLists.txt:
2552         * Modules/fetch/FetchBody.cpp:
2553         (WebCore::FetchBody::consume):
2554         (WebCore::FetchBody::consumeAsStream):
2555         (WebCore::FetchBody::clone):
2556         * Modules/fetch/FetchBody.h:
2557         * Modules/fetch/FetchBodyConsumer.h:
2558         * Modules/fetch/FetchBodyOwner.cpp:
2559         (WebCore::FetchBodyOwner::cloneBody):
2560         (WebCore::FetchBodyOwner::loadBlob):
2561         (WebCore::FetchBodyOwner::readableStream):
2562         (WebCore::FetchBodyOwner::consumeBodyAsStream):
2563         * Modules/fetch/FetchBodyOwner.h:
2564         (WebCore::FetchBodyOwner::feedStream):
2565         (WebCore::FetchBodyOwner::cancel):
2566         * Modules/fetch/FetchBodySource.cpp: Renamed from Source/WebCore/Modules/fetch/FetchResponseSource.cpp.
2567         * Modules/fetch/FetchBodySource.h: Renamed from Source/WebCore/Modules/fetch/FetchResponseSource.h.
2568         * Modules/fetch/FetchResponse.cpp:
2569         (WebCore::FetchResponse::consumeBodyAsStream):
2570         (WebCore::FetchResponse::createReadableStream):
2571         * Modules/fetch/FetchResponse.h:
2572         * Modules/fetch/FetchResponse.idl:
2573         * Modules/fetch/FetchResponse.js:
2574         (getter.body):
2575         (clone):
2576         * WebCore.xcodeproj/project.pbxproj:
2577         * bindings/js/ReadableStream.cpp:
2578         (WebCore::ReadableStream::tee):
2579         * bindings/js/ReadableStream.h:
2580         * bindings/js/WebCoreBuiltinNames.h:
2581
2582 2017-08-31  Chris Dumez  <cdumez@apple.com>
2583
2584         Use WTF::crossThreadCopy() in more places
2585         https://bugs.webkit.org/show_bug.cgi?id=176169
2586
2587         Reviewed by Andreas Kling.
2588
2589         Use WTF::crossThreadCopy() in more places to make code more concise.
2590
2591         * Modules/indexeddb/IDBValue.cpp:
2592         (WebCore::IDBValue::setAsIsolatedCopy):
2593
2594 2017-08-31  Jer Noble  <jer.noble@apple.com>
2595
2596         MSE-to-Canvas painting can become "stuck" during heavy workloads
2597         https://bugs.webkit.org/show_bug.cgi?id=176170
2598
2599         Reviewed by Eric Carlson.
2600
2601         During heavy workloads, the trigger from CMBufferQueue notifying us that we have dipped below
2602         the "low-water mark" of decoded (and decoding) frames will not fire. Instead of using a trigger
2603         (since it will not fire when the number of "frames being decoded" changes, just the number of
2604         decoded frames), just call maybeBecomeReadyForMoreMediaData() whenever the number of frames in
2605         the decoded queue decreases, or when the number of frames being decoded decreases.
2606
2607         * platform/graphics/cocoa/WebCoreDecompressionSession.h:
2608         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
2609         (WebCore::WebCoreDecompressionSession::maybeBecomeReadyForMoreMediaData):
2610         (WebCore::WebCoreDecompressionSession::enqueueSample):
2611         (WebCore::WebCoreDecompressionSession::decodeSample):
2612         (WebCore::WebCoreDecompressionSession::handleDecompressionOutput):
2613         (WebCore::WebCoreDecompressionSession::getFirstVideoFrame):
2614         (WebCore::WebCoreDecompressionSession::automaticDequeue):
2615         (WebCore::WebCoreDecompressionSession::imageForTime):
2616         (WebCore::WebCoreDecompressionSession::maybeBecomeReadyForMoreMediaDataCallback): Deleted.
2617
2618 2017-08-31  Youenn Fablet  <youenn@apple.com>
2619
2620         Move consume promise from FetchBody to FetchBodyConsumer
2621         https://bugs.webkit.org/show_bug.cgi?id=176121
2622
2623         Reviewed by Alex Christensen.
2624
2625         No change of behavior.
2626
2627         FetchBodyConsumer should be made responsible for data consumption through promise getters and ReadableStream.
2628         This will allow making data consumption consistent for Request and Response.
2629         This patch is doing the first step.
2630
2631         * Modules/fetch/FetchBody.cpp:
2632         (WebCore::FetchBody::consumeOnceLoadingFinished):
2633         (WebCore::FetchBody::consumeBlob):
2634         (WebCore::FetchBody::loadingFailed):
2635         (WebCore::FetchBody::loadingSucceeded):
2636         (WebCore::FetchBody::clone const):
2637         * Modules/fetch/FetchBody.h:
2638         (WebCore::FetchBody::cleanConsumer):
2639         (WebCore::FetchBody::cleanConsumePromise): Deleted.
2640         * Modules/fetch/FetchBodyConsumer.cpp:
2641         (WebCore::FetchBodyConsumer::setConsumePromise):
2642         (WebCore::FetchBodyConsumer::loadingFailed):
2643         (WebCore::FetchBodyConsumer::loadingSucceeded):
2644         (WebCore::FetchBodyConsumer::clean):
2645         * Modules/fetch/FetchBodyConsumer.h:
2646         (WebCore::FetchBodyConsumer::clean): Deleted.
2647         * Modules/fetch/FetchBodyOwner.cpp:
2648         (WebCore::FetchBodyOwner::stop):
2649
2650 2017-08-22  Darin Adler  <darin@apple.com>
2651
2652         REGRESSION (r220052): ASSERTION FAILED: !frame().isMainFrame() || !needsStyleRecalcOrLayout()  in WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive()
2653         https://bugs.webkit.org/show_bug.cgi?id=175270
2654
2655         Reviewed by Simon Fraser and Antti Koivisto.
2656
2657         * dom/Document.cpp:
2658         (WebCore::Document::Document): Initialize m_styleRecalcTimer with a lamdba so it can work
2659         with a function that returns a bool and ignore the return value.
2660         (WebCore::Document::updateStyleIfNeeded): Added a boolean return value indicating if the
2661         function did any work or not.
2662         * dom/Document.h: Updated for above change.
2663
2664         * page/FrameView.cpp:
2665         (WebCore::appendRenderedChildren): Added helper that will later replace the
2666         FrameView::renderedChildFrameViews function and is used below.
2667         (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive): Instead of always doing two
2668         passes of style and layout update do up to 25 passes, but stop as soon as a pass does
2669         no work. This is slightly more efficient in cases where no layout and style update is
2670         needed, and works correctly when a additional passes are needed, which is what happens
2671         in the test that was failing. We can eventually improve this further, but this resolves
2672         the immediate problem we are seeing in the test.
2673
2674 2017-08-22  Filip Pizlo  <fpizlo@apple.com>
2675
2676         Strings need to be in some kind of gigacage
2677         https://bugs.webkit.org/show_bug.cgi?id=174924
2678
2679         Reviewed by Oliver Hunt.
2680
2681         No new tests because no new behavior.
2682
2683         * html/canvas/CanvasRenderingContext2D.cpp:
2684         (WebCore::normalizeSpaces):
2685
2686 2017-08-31  Yusuke Suzuki  <utatane.tea@gmail.com>
2687
2688         [JSC] Use reifying system for "name" property of builtin JSFunction
2689         https://bugs.webkit.org/show_bug.cgi?id=175260
2690
2691         Reviewed by Saam Barati.
2692
2693         Test: js/dom/builtin-getter-name.html
2694
2695         Use @getter for JSBuiltin getters.
2696
2697         * Modules/fetch/FetchResponse.js:
2698         (bodyUsed): Deleted.
2699         (body): Deleted.
2700         * Modules/streams/ReadableByteStreamController.js:
2701         (byobRequest): Deleted.
2702         (desiredSize): Deleted.
2703         * Modules/streams/ReadableStream.js:
2704         (locked): Deleted.
2705         * Modules/streams/ReadableStreamBYOBReader.js:
2706         (closed): Deleted.
2707         * Modules/streams/ReadableStreamBYOBRequest.js:
2708         (view): Deleted.
2709         * Modules/streams/ReadableStreamDefaultController.js:
2710         (desiredSize): Deleted.
2711         * Modules/streams/ReadableStreamDefaultReader.js:
2712         (closed): Deleted.
2713         * Modules/streams/WritableStream.js:
2714         (closed): Deleted.
2715         (ready): Deleted.
2716         (state): Deleted.
2717         * bindings/js/JSDOMBuiltinConstructor.h:
2718         (WebCore::JSDOMBuiltinConstructor<JSClass>::finishCreation):
2719
2720 2017-08-30  Chris Dumez  <cdumez@apple.com>
2721
2722         Implement FileSystemDirectoryReader.readEntries()
2723         https://bugs.webkit.org/show_bug.cgi?id=176091
2724         <rdar://problem/34168015>
2725
2726         Reviewed by Andreas Kling.
2727
2728         Tests: editing/pasteboard/datatransfer-items-drop-directoryReader-error.html
2729                editing/pasteboard/datatransfer-items-drop-directoryReader-root.html
2730                editing/pasteboard/datatransfer-items-drop-directoryReader.html
2731
2732         * Modules/entriesapi/DOMFileSystem.cpp:
2733         (WebCore::ListedChild::isolatedCopy const):
2734         (WebCore::listDirectoryWithMetadata):
2735         (WebCore::toFileSystemEntries):
2736         (WebCore::DOMFileSystem::DOMFileSystem):
2737         (WebCore::DOMFileSystem::root):
2738         (WebCore::DOMFileSystem::fileAsEntry):
2739         (WebCore::DOMFileSystem::evaluatePath):
2740         (WebCore::DOMFileSystem::listDirectory):
2741         * Modules/entriesapi/DOMFileSystem.h:
2742         (WebCore::DOMFileSystem::createEntryForFile):
2743         * Modules/entriesapi/DOMFileSystem.idl:
2744         - Implement directory listing operation for supporting
2745           FileSystemDirectoryReader::readEntries().
2746         - Implement evaluatePath() operation as per:
2747           - https://wicg.github.io/entries-api/#evaluate-a-path
2748         - DOMFileSystem should no longer hold a strong reference to
2749           the root entry and FileSystemEntry now holds a strong
2750           reference to the DOMFileSystem and this would create a
2751           cycle.
2752
2753         * Modules/entriesapi/FileSystemDirectoryEntry.cpp:
2754         (WebCore::FileSystemDirectoryEntry::createReader):
2755         * Modules/entriesapi/FileSystemDirectoryEntry.h:
2756         * Modules/entriesapi/FileSystemDirectoryEntry.idl:
2757         Have createReader() take a ScriptExecutionContext, which is needed
2758         to construct a FileSystemDirectoryReader, now that FileSystemDirectoryReader
2759         is an ActiveDOMObject.
2760
2761         * Modules/entriesapi/FileSystemDirectoryReader.cpp:
2762         (WebCore::FileSystemDirectoryReader::FileSystemDirectoryReader):
2763         (WebCore::FileSystemDirectoryReader::activeDOMObjectName const):
2764         (WebCore::FileSystemDirectoryReader::canSuspendForDocumentSuspension const):
2765         (WebCore::FileSystemDirectoryReader::readEntries):
2766         * Modules/entriesapi/FileSystemDirectoryReader.h:
2767         * Modules/entriesapi/FileSystemDirectoryReader.idl:
2768         Provide implementation for FileSystemDirectoryReader.readEntries() as per:
2769         - https://wicg.github.io/entries-api/#dom-filesystemdirectoryreader-readentries
2770         For the actual directory listing operation, we ask the DOMFileSystem, which is
2771         where all filesystem operations should live.
2772         Also made the FileSystemDirectoryReader an ActiveDOMObject to keep it and its
2773         wrapper alive while a file system operation is pending.
2774
2775         * Modules/entriesapi/FileSystemEntry.cpp:
2776         (WebCore::FileSystemEntry::~FileSystemEntry):
2777         (WebCore::FileSystemEntry::filesystem const):
2778         * Modules/entriesapi/FileSystemEntry.h:
2779         Make FileSystemEntry keep a strong reference to its DOMFileSystem object.
2780         Previously, the DOMFileSystem was kept alive by the DataTransferItem but
2781         this was unsafe because FileSystemEntry may outlive the DataTransferItem.
2782
2783         * dom/ActiveDOMObject.h:
2784         (WebCore::ActiveDOMObject::PendingActivity::PendingActivity):
2785         (WebCore::ActiveDOMObject::PendingActivity::~PendingActivity):
2786         (WebCore::ActiveDOMObject::makePendingActivity):
2787         Add PendingActivity / makePendingActivity() as a less error-prone
2788         replacement for setPendingActivity() / unsetPendingActivity().
2789
2790         * dom/DOMException.cpp:
2791         (WebCore::DOMException::create):
2792         * dom/DOMException.h:
2793         Add factory to construct a DOMException from an Exception.
2794
2795         * dom/DataTransferItem.cpp:
2796         (WebCore::DataTransferItem::getAsEntry const):
2797         * dom/DataTransferItem.h:
2798
2799         * dom/Exception.h:
2800         (WebCore::Exception::isolatedCopy const):
2801         * dom/ExceptionOr.h:
2802         Make ExceptionOr<> / Exception work with CrossThreadCopier for convenience.
2803
2804         * html/FileListCreator.cpp:
2805         (WebCore::FileListCreator::FileListCreator):
2806         Use crossThreadCopy() instead of longer form.
2807
2808         * platform/FileSystem.h:
2809         * platform/glib/FileSystemGlib.cpp:
2810         (WebCore::pathByAppendingComponents):
2811         * platform/posix/FileSystemPOSIX.cpp:
2812         (WebCore::pathByAppendingComponents):
2813         * platform/win/FileSystemWin.cpp:
2814         (WebCore::pathByAppendingComponents):
2815         Add pathByAppendingComponents() utility function, which is similar to
2816         pathByAppendingComponent() but supports appending multiple components
2817         in an efficient fashion.
2818
2819 2017-08-30  Antti Koivisto  <antti@apple.com>
2820
2821         Factor RenderMultiColumnFlowThread construction and destruction into RenderTreeUpdater helper
2822         https://bugs.webkit.org/show_bug.cgi?id=176130
2823
2824         Reviewed by Zalan Bujtas.
2825
2826         Move mutation code out of the render tree.
2827
2828         * WebCore.xcodeproj/project.pbxproj:
2829         * rendering/RenderBlockFlow.cpp:
2830         (WebCore::RenderBlockFlow::createMultiColumnFlowThread): Deleted.
2831         (WebCore::RenderBlockFlow::destroyMultiColumnFlowThread): Deleted.
2832         * rendering/RenderBlockFlow.h:
2833         * style/RenderTreeUpdater.cpp:
2834         (WebCore::RenderTreeUpdater::commit):
2835         (WebCore::RenderTreeUpdater::updateAfterDescendants):
2836         (WebCore::updateMultiColumnFlowThread): Deleted.
2837         * style/RenderTreeUpdater.h:
2838         * style/RenderTreeUpdaterMultiColumn.cpp: Added.
2839         (WebCore::RenderTreeUpdater::MultiColumn::update):
2840         (WebCore::RenderTreeUpdater::MultiColumn::createFlowThread):
2841         * style/RenderTreeUpdaterMultiColumn.h: Added.
2842
2843 2017-08-30  Myles C. Maxfield  <mmaxfield@apple.com>
2844
2845         Previous elements with lang= can affect fonts selected for subsequent elements
2846         https://bugs.webkit.org/show_bug.cgi?id=175959
2847         <rdar://problem/33785853>
2848
2849         Reviewed by Zalan Bujtas.
2850
2851         FontCascade::update() was erroneously getting a cache hit. Elements with different lang=
2852         should be distinct inside the FontCascadeCache. We should be keying off of the locale
2853         string instead of the script enum because the string is the thing we actually pass to the
2854         platform APIs when performing font selection. This is a regression because we only
2855         recently (within the past few years) started making font selection sensitive to lang= at
2856         all.
2857
2858         Test: fast/text/lang-font-selection-cache.html
2859
2860         * platform/graphics/FontCache.h:
2861         (WebCore::FontDescriptionKey::FontDescriptionKey):
2862         (WebCore::FontDescriptionKey::operator== const):
2863         (WebCore::FontDescriptionKey::computeHash const):
2864
2865 2017-08-30  Ryan Haddad  <ryanhaddad@apple.com>
2866
2867         Unreviewed, rolling out r221327.
2868
2869         This change caused test262 failures.
2870
2871         Reverted changeset:
2872
2873         "[JSC] Use reifying system for "name" property of builtin
2874         JSFunction"
2875         https://bugs.webkit.org/show_bug.cgi?id=175260
2876         http://trac.webkit.org/changeset/221327
2877
2878 2017-08-30  Youenn Fablet  <youenn@apple.com>
2879
2880         [Cache API] Support cache names persistency
2881         https://bugs.webkit.org/show_bug.cgi?id=175995
2882
2883         Reviewed by Alex Christensen.
2884
2885         Test: http/tests/cache-storage/cache-persistency.https.html
2886
2887         Adding method to clear the memory representation of the cache storage.
2888         Exposing it as internals so that layout tests can be used for testing persistency by combining clearing and private browsing mode.
2889
2890         Introducing ReadDisk and WriteDisk errors that are used by CacheStorage::Engine.
2891
2892         * Modules/cache/CacheStorageConnection.h:
2893         (WebCore::CacheStorageConnection::clearMemoryRepresentation):
2894         * Modules/cache/DOMCache.cpp:
2895         (WebCore::DOMCache::errorToException):
2896         * Modules/cache/DOMCache.h:
2897         * testing/Internals.cpp:
2898         (WebCore::Internals::clearCacheStorageMemoryRepresentation):
2899         * testing/Internals.h:
2900         * testing/Internals.idl:
2901
2902 2017-08-30  Matt Lewis  <jlewis3@apple.com>
2903
2904         Unreviewed, rolling out r221384.
2905
2906         This patch caused multiple 32-bit JSC test failures.
2907
2908         Reverted changeset:
2909
2910         "Strings need to be in some kind of gigacage"
2911         https://bugs.webkit.org/show_bug.cgi?id=174924
2912         http://trac.webkit.org/changeset/221384
2913
2914 2017-08-30  Brady Eidson  <beidson@apple.com>
2915
2916         Add "Identified" base class to replace a whole bunch of custom identifier generators.
2917         https://bugs.webkit.org/show_bug.cgi?id=176120
2918
2919         Reviewed by Alex Christensen.
2920
2921         No new tests (No behavior change).
2922
2923         Instead of repeating the common pattern of a class with an integer identifier keeping its
2924         own static counter of the next identifier and generating it for each instance, this
2925         uses a common template in WTF that does that automatically.
2926
2927         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
2928         (WebCore::IDBServer::UniqueIDBDatabaseConnection::UniqueIDBDatabaseConnection):
2929         (WebCore::IDBServer::UniqueIDBDatabaseConnection::connectionPendingCloseFromClient):
2930         (WebCore::IDBServer::UniqueIDBDatabaseConnection::connectionClosedFromClient):
2931         (WebCore::IDBServer::UniqueIDBDatabaseConnection::confirmDidCloseFromServer):
2932         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didFireVersionChangeEvent):
2933         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didFinishHandlingVersionChange):
2934         (WebCore::IDBServer::UniqueIDBDatabaseConnection::createVersionChangeTransaction):
2935         (WebCore::IDBServer::UniqueIDBDatabaseConnection::establishTransaction):
2936         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didAbortTransaction):
2937         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didCommitTransaction):
2938         (WebCore::IDBServer::nextDatabaseConnectionIdentifier): Deleted.
2939         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
2940         (WebCore::IDBServer::UniqueIDBDatabaseConnection::identifier const): Deleted.
2941
2942         * workers/service/ServiceWorkerJobData.cpp:
2943         (WebCore::ServiceWorkerJobData::ServiceWorkerJobData):
2944         (WebCore::ServiceWorkerJobData::isolatedCopy const):
2945         * workers/service/ServiceWorkerJobData.h:
2946         (WebCore::ServiceWorkerJobData::encode const):
2947         (WebCore::ServiceWorkerJobData::decode):
2948         (WebCore::ServiceWorkerJobData::identifier const): Deleted.
2949
2950         * workers/service/server/SWServer.cpp:
2951         (WebCore::SWServer::Connection::Connection):
2952         * workers/service/server/SWServer.h:
2953         (WebCore::SWServer::Connection::identifier const): Deleted.
2954
2955         * workers/service/server/SWServerRegistration.cpp:
2956         (WebCore::SWServerRegistration::SWServerRegistration):
2957         (WebCore::SWServerRegistration::data const):
2958         * workers/service/server/SWServerRegistration.h:
2959         (WebCore::SWServerRegistration::identifier const): Deleted.
2960
2961 2017-08-30  Youenn Fablet  <youenn@apple.com>
2962
2963         Remove FetchRequest::InternalRequest
2964         https://bugs.webkit.org/show_bug.cgi?id=176085
2965
2966         Reviewed by Alex Christensen.
2967
2968         No change of behavior.
2969
2970         Removing InternalRequest struct and passing/defining fields directly.
2971
2972         * Modules/cache/Cache.cpp:
2973         (WebCore::Cache::updateRecords):
2974         * Modules/fetch/FetchRequest.cpp:
2975         (WebCore::computeReferrer):
2976         (WebCore::buildOptions):
2977         (WebCore::methodCanHaveBody):
2978         (WebCore::FetchRequest::initializeOptions):
2979         (WebCore::FetchRequest::initializeWith):
2980         (WebCore::FetchRequest::setBody):
2981         (WebCore::FetchRequest::create):
2982         (WebCore::FetchRequest::referrer const):
2983         (WebCore::FetchRequest::urlString const):
2984         (WebCore::FetchRequest::resourceRequest const):
2985         (WebCore::FetchRequest::clone):
2986         (WebCore::setReferrer): Deleted.
2987         * Modules/fetch/FetchRequest.h:
2988         (WebCore::FetchRequest::FetchRequest):
2989         (WebCore::FetchRequest::cache const):
2990         (WebCore::FetchRequest::credentials const):
2991         (WebCore::FetchRequest::destination const):
2992         (WebCore::FetchRequest::mode const):
2993         (WebCore::FetchRequest::redirect const):
2994         (WebCore::FetchRequest::referrerPolicy const):
2995         (WebCore::FetchRequest::type const):
2996
2997 2017-08-30  Youenn Fablet  <youenn@apple.com>
2998
2999         Add support for FetchRequest.body
3000         https://bugs.webkit.org/show_bug.cgi?id=176066
3001         <rdar://problem/34148373>
3002
3003         Reviewed by Sam Weinig and Alex Christensen.
3004
3005         Follow-up to https://trac.webkit.org/r221329 as per post landing comments.
3006         Returning a RefPtr<ReadableStream> so as to to not specialize ReadableStream converter.
3007
3008         * Modules/fetch/FetchBodyOwner.cpp:
3009         (WebCore::FetchBodyOwner::readableStream):
3010         * Modules/fetch/FetchBodyOwner.h:
3011         * bindings/js/ReadableStream.h:
3012         (WebCore::toJS):
3013         (WebCore::JSConverter<IDLInterface<ReadableStream>>::convert): Deleted.
3014
3015 2017-08-30  Per Arne Vollan  <pvollan@apple.com>
3016
3017         [Win] Crash in MathML layout test.
3018         https://bugs.webkit.org/show_bug.cgi?id=176109
3019
3020         Reviewed by Brent Fulgham.
3021
3022         Return early if no font can be found for code point.
3023
3024         No new tests, covered by existing tests. 
3025
3026         * rendering/mathml/MathOperator.cpp:
3027         (WebCore::MathOperator::paintVerticalGlyphAssembly):
3028         (WebCore::MathOperator::paintHorizontalGlyphAssembly):
3029
3030 2017-08-30  Brady Eidson  <beidson@apple.com>
3031
3032         Implement all of "Register" right up until where the script is fetched.
3033         https://bugs.webkit.org/show_bug.cgi?id=176082
3034
3035         Reviewed by Andy Estes.
3036
3037         Test: http/tests/workers/service/basic-register-exceptions.html
3038
3039         This patch implements every detail of the "Register" and "Update" algorithms right up to
3040         where we would actually fetch the service worker script file.
3041
3042         It also includes miscellaneous refactoring and cleanup along the way.
3043
3044         * CMakeLists.txt:
3045         * WebCore.xcodeproj/project.pbxproj:
3046
3047         * page/SecurityOrigin.cpp:
3048         (WebCore::shouldTreatAsPotentiallyTrustworthy): Expose in the header for other files to use.
3049         * page/SecurityOrigin.h:
3050
3051         * workers/service/ServiceWorkerContainer.cpp:
3052         (WebCore::ServiceWorkerContainer::addRegistration): Add some more exception cases from the spec.
3053         (WebCore::ServiceWorkerContainer::scheduleJob): Use the correct job identifier.
3054         (WebCore::ServiceWorkerContainer::jobFailedWithException):
3055         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
3056         (WebCore::ServiceWorkerContainer::jobDidFinish):
3057         * workers/service/ServiceWorkerContainer.h:
3058
3059         * workers/service/ServiceWorkerJob.cpp:
3060         (WebCore::ServiceWorkerJob::ServiceWorkerJob):
3061         (WebCore::ServiceWorkerJob::failedWithException): Call through to the client to handle the failure.
3062         (WebCore::ServiceWorkerJob::resolvedWithRegistration): Call through to the client to handle success.
3063         * workers/service/ServiceWorkerJob.h:
3064         (WebCore::ServiceWorkerJob::promise):
3065         (WebCore::ServiceWorkerJob::identifier const): Deleted. Rely on the identifier from the JobData.
3066
3067         * workers/service/ServiceWorkerJobClient.h:
3068
3069         * workers/service/ServiceWorkerJobData.cpp:
3070         (WebCore::ServiceWorkerJobData::ServiceWorkerJobData):
3071         (WebCore::ServiceWorkerJobData::isolatedCopy const):
3072         * workers/service/ServiceWorkerJobData.h:
3073         (WebCore::ServiceWorkerJobData::identifier const):
3074         (WebCore::ServiceWorkerJobData::encode const):
3075         (WebCore::ServiceWorkerJobData::decode):
3076         (WebCore::ServiceWorkerJobData::jobIdentifier const): Deleted.
3077
3078         * workers/service/ServiceWorkerRegistration.cpp:
3079         (WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration): Make this class an ActiveDOMObject
3080           both because it *is* an active DOM object and because we need to get at the ScriptExecutionContext.
3081         * workers/service/ServiceWorkerRegistration.h:
3082
3083         Add a class to encapsulate everything about a registration for encode/decode/crossthread:
3084         * workers/service/ServiceWorkerRegistrationData.cpp:
3085         (WebCore::ServiceWorkerRegistrationData::isolatedCopy const):
3086         * workers/service/ServiceWorkerRegistrationData.h: 
3087         (WebCore::ServiceWorkerRegistrationData::encode const):
3088         (WebCore::ServiceWorkerRegistrationData::decode):
3089
3090         * workers/service/ServiceWorkerRegistrationKey.cpp:
3091         (WebCore::ServiceWorkerRegistrationKey::isolatedCopy const):
3092         * workers/service/ServiceWorkerRegistrationKey.h:
3093         (WebCore::ServiceWorkerRegistrationKey::encode const):
3094         (WebCore::ServiceWorkerRegistrationKey::decode):
3095
3096         * workers/service/server/SWClientConnection.cpp:
3097         (WebCore::SWClientConnection::scheduleJob):
3098         (WebCore::SWClientConnection::jobResolvedInServer):
3099         * workers/service/server/SWClientConnection.h:
3100
3101         * workers/service/server/SWServer.cpp:
3102         (WebCore::SWServer::~SWServer):
3103         (WebCore::SWServer::Connection::scheduleJobInServer):
3104         (WebCore::SWServer::scheduleJob):
3105         (WebCore::SWServer::rejectJob):
3106         (WebCore::SWServer::resolveJob):
3107         * workers/service/server/SWServer.h:
3108
3109         * workers/service/server/SWServerRegistration.cpp:
3110         (WebCore::SWServerRegistration::SWServerRegistration):
3111         (WebCore::SWServerRegistration::startNextJob):
3112         (WebCore::SWServerRegistration::isEmpty):
3113         (WebCore::SWServerRegistration::getNewestWorker): Implement "Get Newest Worker" algorithm.
3114         (WebCore::SWServerRegistration::runRegisterJob): Implement the rest of the "Register" algorithm.
3115         (WebCore::SWServerRegistration::runUpdateJob): Implement every part of "Update" up to where we would fetch.
3116         (WebCore::SWServerRegistration::rejectWithExceptionOnMainThread):
3117         (WebCore::SWServerRegistration::resolveWithRegistrationOnMainThread):
3118         (WebCore::SWServerRegistration::resolveCurrentJob):
3119         (WebCore::SWServerRegistration::data const):
3120         (WebCore::SWServerRegistration::performCurrentJob): Deleted.
3121         * workers/service/server/SWServerRegistration.h:
3122         (WebCore::SWServerRegistration::identifier const):
3123
3124         Add a stub class to represent "active service workers" in the SWServer:
3125         * workers/service/server/SWServerWorker.cpp:
3126         (WebCore::SWServerWorker::SWServerWorker):
3127         (WebCore::SWServerWorker::~SWServerWorker):
3128         * workers/service/server/SWServerWorker.h: 
3129         (WebCore::SWServerWorker::scriptURL const):
3130
3131 2017-08-30  Don Olmstead  <don.olmstead@sony.com>
3132
3133         [CMake][WinCairo] Use find_package for libpng and libjpeg
3134         https://bugs.webkit.org/show_bug.cgi?id=176113
3135
3136         Reviewed by Alex Christensen.
3137
3138         No new tests. No change in behavior.
3139
3140         * PlatformWinCairo.cmake:
3141         * platform/ImageDecoders.cmake:
3142
3143 2017-08-22  Matt Rajca  <mrajca@apple.com>
3144
3145         Opt all Mac clients into document-level media user gesture quirks.
3146         https://bugs.webkit.org/show_bug.cgi?id=175831
3147
3148         This un-breaks many of the sites that take a long time to load video ad elements on-demand.
3149
3150         Reviewed by Eric Carlson.
3151
3152         Test: media/document-level-media-user-gesture-quirk.html
3153
3154         * html/MediaElementSession.cpp:
3155         (WebCore::MediaElementSession::playbackPermitted const):
3156         (WebCore::needsDocumentLevelMediaUserGestureQuirk): Deleted.
3157
3158 2017-08-22  Filip Pizlo  <fpizlo@apple.com>
3159
3160         Strings need to be in some kind of gigacage
3161         https://bugs.webkit.org/show_bug.cgi?id=174924
3162
3163         Reviewed by Oliver Hunt.
3164
3165         No new tests because no new behavior.
3166
3167         * html/canvas/CanvasRenderingContext2D.cpp:
3168         (WebCore::normalizeSpaces):
3169
3170 2017-08-30  Andy Estes  <aestes@apple.com>
3171
3172         [Mac] Upstream Accessibility-related WebKitSystemInterface functions
3173         https://bugs.webkit.org/show_bug.cgi?id=176093
3174
3175         Reviewed by Eric Carlson.
3176
3177         * accessibility/mac/AXObjectCacheMac.mm:
3178         (WebCore::AXObjectCache::platformHandleFocusedUIElementChanged):
3179         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3180         (-[WebAccessibilityObjectWrapper unregisterUniqueIdForUIElement]):
3181         (AXObjectIsTextMarker):
3182         (AXObjectIsTextMarkerRange):
3183         (AXTextMarkerRange):
3184         (AXTextMarkerRangeStart):
3185         (AXTextMarkerRangeEnd):
3186         (getBytesFromAXTextMarker):
3187         (isTextMarkerIgnored):
3188         (accessibilityObjectForTextMarker):
3189         (startOrEndTextmarkerForRange):
3190         (nextTextMarkerForCharacterOffset):
3191         (previousTextMarkerForCharacterOffset):
3192         (textMarkerForCharacterOffset):
3193         (characterOffsetForTextMarker):
3194         (textMarkerForVisiblePosition):
3195         (-[WebAccessibilityObjectWrapper textMarkerForFirstPositionInTextControl:]):
3196         (visiblePositionForTextMarker):
3197         (AXAttributeStringSetElement):
3198         * platform/mac/WebCoreSystemInterface.h:
3199         * platform/mac/WebCoreSystemInterface.mm:
3200
3201 2017-08-30  Antti Koivisto  <antti@apple.com>
3202
3203         RenderMultiColumnFlowThread - Avoid render tree mutation during layout
3204         https://bugs.webkit.org/show_bug.cgi?id=176026
3205         <rdar://problem/33402891>
3206
3207         Reviewed by Zalan Bujtas.
3208
3209         Mutations should be done in RenderTreeUpdater.
3210
3211         * rendering/RenderBlockFlow.cpp:
3212         (WebCore::RenderBlockFlow::willCreateColumns const):
3213
3214             Don't create columns for RenderSVGBlock. Before this patch this was avoided because it
3215             has custom layout() function that doesn't call to setComputedColumnCountAndWidth.
3216             Same for mathml and ruby.
3217
3218             Don't create columns for pseudo elements (first-letter mostly).
3219
3220         (WebCore::RenderBlockFlow::setComputedColumnCountAndWidth):
3221
3222             This now assumes that the multicolumn renderer has been initialized correctly already.
3223
3224         * rendering/RenderBlockFlow.h:
3225         * style/RenderTreeUpdater.cpp:
3226         (WebCore::updateMultiColumnFlowThread):
3227
3228             Create or delte multicolumn renderer after descendants are known.
3229
3230         (WebCore::RenderTreeUpdater::commit):
3231         (WebCore::RenderTreeUpdater::updateAfterDescendants):
3232
3233 2017-08-30  Said Abou-Hallawa  <sabouhallawa@apple.com>
3234
3235         The SVG fragment identifier is not respected if it is a part of an HTTP URL
3236         https://bugs.webkit.org/show_bug.cgi?id=163811
3237
3238         Reviewed by Darin Adler.
3239
3240         If an image is referenced more than once in a page and the URL to that
3241         image is an HTTP URL, one CachedImage is created for all the renderers
3242         even if the original URLs have different fragmentIdentifiers. In this
3243         case the fragment will be removed from the request which is associated
3244         with the shared CachedImage. This CachedImage creates an SVGImage with
3245         a URL but without a fragmentIdentifier. So SVGImage::draw() does not call
3246         FrameView::scrollToFragment() and therefore the viewport is not setup
3247         correctly for displaying the SVG in this case.
3248
3249         The fix is to move the url from the SVGImage to SVGImageForContainer.
3250         Because there is one SVGImageForContainer created for every renderer,
3251         we can move the full URL there. The drawing of an SVGImage has to start
3252         from the SVGImageForContainer::draw() because the SVGImage may not have
3253         an intrinsic size and the SVGImageForContainer is the one which knows
3254         the destination rectangle. So SVGImageForContainer can pass the full url
3255         to SVGImage::drawForContainer() which can be used to scrollToFragment()
3256         before calling SVGImage::draw().
3257         
3258         For clarity and consistency, all setContainerSizeForRenderer() will be 
3259         changed to setContainerContext() and the pair SizeAndZoom will be replaced
3260         by the struct ContainerContext.
3261
3262         Tests: http/tests/svg/svg-fragment-background.html
3263                http/tests/svg/svg-fragment-image.html
3264
3265         * css/CSSCursorImageValue.h:
3266         * css/CSSImageSetValue.cpp:
3267         (WebCore::CSSImageSetValue::fillImageSet):
3268         * css/CSSImageSetValue.h:
3269         * loader/cache/CachedImage.cpp:
3270         (WebCore::CachedImage::didRemoveClient):
3271         (WebCore::CachedImage::switchClientsToRevalidatedResource):
3272         (WebCore::CachedImage::allClientsRemoved):
3273         (WebCore::CachedImage::setContainerContextForClient):
3274         (WebCore::CachedImage::clear):
3275         (WebCore::CachedImage::createImage):
3276         (WebCore::CachedImage::setContainerSizeForRenderer): Deleted.
3277         * loader/cache/CachedImage.h:
3278         * rendering/RenderBoxModelObject.cpp:
3279         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry const):
3280         (WebCore::RenderBoxModelObject::paintNinePieceImage):
3281         * rendering/RenderImage.cpp:
3282         (WebCore::RenderImage::updateInnerContentRect):
3283         (WebCore::RenderImage::repaintOrMarkForLayout):
3284         * rendering/RenderImageResource.cpp:
3285         (WebCore::RenderImageResource::setContainerContext):
3286         (WebCore::RenderImageResource::setContainerSizeForRenderer): Deleted.
3287         * rendering/RenderImageResource.h:
3288         * rendering/RenderImageResourceStyleImage.cpp:
3289         (WebCore::RenderImageResourceStyleImage::setContainerContext):
3290         (WebCore::RenderImageResourceStyleImage::setContainerSizeForRenderer): Deleted.
3291         * rendering/RenderImageResourceStyleImage.h:
3292         * rendering/RenderListMarker.cpp:
3293         (WebCore::RenderListMarker::updateContent):
3294         * rendering/shapes/ShapeOutsideInfo.cpp:
3295         (WebCore::ShapeOutsideInfo::createShapeForImage const):
3296         * rendering/style/StyleCachedImage.cpp:
3297         (WebCore::StyleCachedImage::imageURL):
3298         (WebCore::StyleCachedImage::setContainerContextForRenderer):
3299         (WebCore::StyleCachedImage::setContainerSizeForRenderer): Deleted.
3300         * rendering/style/StyleCachedImage.h:
3301         * rendering/style/StyleGeneratedImage.h:
3302         * rendering/style/StyleImage.h:
3303         * rendering/svg/RenderSVGImage.cpp:
3304         (WebCore::RenderSVGImage::updateImageViewport):
3305         * svg/SVGImageElement.h:
3306         * svg/graphics/SVGImage.cpp:
3307         (WebCore::SVGImage::SVGImage):
3308         (WebCore::SVGImage::drawForContainer):
3309         (WebCore::SVGImage::drawPatternForContainer):
3310         (WebCore::SVGImage::draw):
3311         (WebCore::SVGImage::dump const): Deleted.
3312         * svg/graphics/SVGImage.h:
3313         * svg/graphics/SVGImageCache.cpp:
3314         (WebCore::SVGImageCache::setContainerContextForClient):
3315         (WebCore::SVGImageCache::setContainerSizeForRenderer): Deleted.
3316         * svg/graphics/SVGImageCache.h:
3317         * svg/graphics/SVGImageForContainer.cpp:
3318         (WebCore::SVGImageForContainer::size const):
3319         (WebCore::SVGImageForContainer::draw):
3320         (WebCore::SVGImageForContainer::drawPattern):
3321         * svg/graphics/SVGImageForContainer.h:
3322
3323 2017-08-29  Wenson Hsieh  <wenson_hsieh@apple.com>
3324
3325         REGRESSION(r210287) On drop, event.dataTransfer.getData("text") returns an empty string when dragging an image
3326         https://bugs.webkit.org/show_bug.cgi?id=170637
3327         <rdar://problem/31347248>
3328
3329         Reviewed by Ryosuke Niwa.
3330
3331         In r210287, the behavior of DragData::containsFiles was changed to return true if NSFilesPromisePboardType is
3332         present in the pasteboard. This means that we will consider images dragged from web content, for which we add
3333         the NSFilesPromisePboardType UTI, as containing files on the pasteboard; this, in turn, means we'll initialize
3334         the DataTransfer upon drop with m_forFileDrag set to true. Due to early returns in getData() and setData() to
3335         deny data access when dropping a dragged file, this means the page won't ever get access to the URL in the
3336         pasteboard due to the presence of the NSFilesPromisePboardType UTI.
3337
3338         To fix this, we replace the early m_forFileDrag returns in getData and setData, instead early returning the null
3339         string if there are any file URLs present on the pasteboard (determined via readFilenames() retrieving a non-
3340         empty result).
3341
3342         Test: editing/pasteboard/drag-drop-href-as-text-data.html
3343
3344         * dom/DataTransfer.cpp:
3345         (WebCore::DataTransfer::DataTransfer):
3346         (WebCore::DataTransfer::getData const):
3347         (WebCore::DataTransfer::setData):
3348
3349         Rather than bail upon forFileDrag() (formerly, m_forFileDrag) being true, bail if there are any file URLs
3350         present on the pasteboard. It seems like this was the intention of the early return in the first place, to
3351         prevent the page from being able to ask for a real file URL when dragging a file.
3352
3353         (WebCore::DataTransfer::files const):
3354         (WebCore::DataTransfer::setDragImage):
3355         (WebCore::DataTransfer::setDropEffect):
3356         (WebCore::DataTransfer::setEffectAllowed):
3357
3358         Swap m_forDrag and m_forFileDrag with forDrag() and forFileDrag(), respectively.
3359
3360         * dom/DataTransfer.h:
3361         (WebCore::DataTransfer::forDrag const):
3362         (WebCore::DataTransfer::forFileDrag const):
3363
3364         Instead of caching two bools to represent state (m_forDrag and m_forFileDrag), just remember the DataTransfer's
3365         m_type and turn the flags into const helpers that check for the value of m_type.
3366
3367 2017-08-29  Youenn Fablet  <youenn@apple.com>
3368
3369         [Fetch API] Request should throw when keep alive is true and body is a ReadableStream
3370         https://bugs.webkit.org/show_bug.cgi?id=176083
3371
3372         Reviewed by Alex Christensen.
3373
3374         Covered by rebased test.
3375
3376         * Modules/fetch/FetchRequest.cpp:
3377         (WebCore::FetchRequest::setBody):
3378
3379 2017-08-29  Don Olmstead  <don.olmstead@sony.com>
3380
3381         [CMake] Use find_package for zlib
3382         https://bugs.webkit.org/show_bug.cgi?id=176075
3383
3384         Reviewed by Alex Christensen.
3385
3386         No new tests. No change in behavior.
3387
3388         * CMakeLists.txt:
3389         * PlatformAppleWin.cmake:
3390         * PlatformMac.cmake:
3391         * PlatformWinCairo.cmake:
3392
3393 2017-08-29  Devin Rousso  <webkit@devinrousso.com>
3394
3395         CallTracingCallback should ignore `readonly attribute`
3396         https://bugs.webkit.org/show_bug.cgi?id=176070
3397
3398         Reviewed by Matt Baker.
3399
3400         Update existing tests to remove calls to existing readonly attributes.
3401
3402         * bindings/scripts/CodeGeneratorJS.pm:
3403         (GenerateAttributeGetterBodyDefinition):
3404         If the attribute is marked `readonly` do not add logic for the `CallTracingCallback`.
3405
3406         * bindings/scripts/test/TestCallTracer.idl:
3407         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
3408         (WebCore::JSTestCallTracerConstructor::initializeProperties):
3409         (WebCore::jsTestCallTracerTestReadonlyAttributeGetter):
3410         (WebCore::jsTestCallTracerTestReadonlyAttribute):
3411
3412 2017-08-29  Said Abou-Hallawa  <sabouhallawa@apple.com>
3413
3414         Assertion failure when opening a file with a missing tag closing bracket
3415         https://bugs.webkit.org/show_bug.cgi?id=176061
3416
3417         Reviewed by Darin Adler.
3418
3419         If a tag is missing its closing bracket, the tokenizer just needs to advance()
3420         the character position without checking m_currentCharacter != '\n'. Newline
3421         character is a valid ending for partially closed tags.
3422
3423         Test: fast/tokenizer/missing-script-tag-closing-bracket.html