Rolling out the previous to land again with a test.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-09-18  Antti Koivisto  <antti@apple.com>
2
3         Rolling out the previous to land again with a test.
4
5         * dom/Document.cpp:
6         (WebCore::Document::setFocusedElement):
7         * html/HTMLInputElement.cpp:
8         (WebCore::HTMLInputElement::didBlur):
9
10 2017-09-18  Antti Koivisto  <antti@apple.com>
11
12         Avoid style resolution when clearing focused element.
13         https://bugs.webkit.org/show_bug.cgi?id=176224
14         <rdar://problem/34206409>
15
16         Reviewed by Zalan Bujtas.
17
18         Test: fast/dom/focus-style-resolution.html
19
20         * dom/Document.cpp:
21         (WebCore::Document::setFocusedElement):
22
23             Don't do synchronous style resolution with FocusRemovalEventsMode::DoNotDispatch.
24             Style resolution may dispatch events.
25
26         * html/HTMLInputElement.cpp:
27         (WebCore::HTMLInputElement::didBlur):
28
29             Move resolveStyleIfNeeded call to setFocusedElement. It is the only client for didBlur.
30
31 2017-09-18  Per Arne Vollan  <pvollan@apple.com>
32
33         [WK1] Layout Test fast/events/beforeunload-dom-manipulation-crash.html is crashing.
34         https://bugs.webkit.org/show_bug.cgi?id=177071
35
36         Reviewed by Brent Fulgham.
37
38         The Page pointer in the history controller's frame is null. Add a null pointer check before
39         accessing the page. 
40
41         No new tests, covered by exiting tests.
42
43         * loader/HistoryController.cpp:
44         (WebCore::HistoryController::updateForStandardLoad):
45         (WebCore::HistoryController::updateForRedirectWithLockedBackForwardList):
46         (WebCore::HistoryController::updateForClientRedirect):
47
48 2017-09-17  Carlos Garcia Campos  <cgarcia@igalia.com>
49
50         REGRESSION(r221974): [Harfbuzz] Test fast/text/international/hebrew-selection.html is failing since r221974
51         https://bugs.webkit.org/show_bug.cgi?id=177036
52
53         Reviewed by Michael Catanzaro.
54
55         In r221974 I rewrote the characterIndexForXPosition implementation without taking into account that there can be
56         multiple glyphs for the same character, so we can't simply do index++ and index-- to get the next and previous
57         character index.
58
59         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
60         (WebCore::HarfBuzzShaper::HarfBuzzRun::characterIndexForXPosition): Always get the character index from
61         m_glyphToCharacterIndexes array.
62
63 2017-09-18  Jer Noble  <jer.noble@apple.com>
64
65         Virtualize ImageDecoder
66         https://bugs.webkit.org/show_bug.cgi?id=176118
67
68         Reviewed by Eric Carlson.
69
70         Add an explicit, abstract base class ImageDecoder, and convert ImageDecoderCG to a true
71         subclass. This will allow multiple ImageDecoder subclasses to exist simultaneously at
72         runtime.
73
74         * CMakeLists.txt:
75         * WebCore.xcodeproj/project.pbxproj:
76         * platform/ImageDecoders.cmake:
77         * platform/graphics/ImageDecoder.cpp: Added.
78         (WebCore::ImageDecoder::create):
79         (WebCore::ImageDecoder::bytesDecodedToDetermineProperties):
80         * platform/graphics/ImageDecoder.h: Added.
81         (WebCore::ImageDecoder::isSizeAvailable):
82         (WebCore::ImageDecoder::isAllDataReceived const):
83         * platform/graphics/cg/ImageDecoderCG.cpp:
84         (WebCore::ImageDecoderCG::ImageDecoderCG):
85         (WebCore::ImageDecoderCG::bytesDecodedToDetermineProperties):
86         (WebCore::ImageDecoderCG::uti const):
87         (WebCore::ImageDecoderCG::filenameExtension const):
88         (WebCore::ImageDecoderCG::encodedDataStatus const):
89         (WebCore::ImageDecoderCG::frameCount const):
90         (WebCore::ImageDecoderCG::repetitionCount const):
91         (WebCore::ImageDecoderCG::hotSpot const):
92         (WebCore::ImageDecoderCG::frameSizeAtIndex const):
93         (WebCore::ImageDecoderCG::frameIsCompleteAtIndex const):
94         (WebCore::ImageDecoderCG::frameOrientationAtIndex const):
95         (WebCore::ImageDecoderCG::frameDurationAtIndex const):
96         (WebCore::ImageDecoderCG::frameAllowSubsamplingAtIndex const):
97         (WebCore::ImageDecoderCG::frameHasAlphaAtIndex const):
98         (WebCore::ImageDecoderCG::frameBytesAtIndex const):
99         (WebCore::ImageDecoderCG::createFrameImageAtIndex const):
100         (WebCore::ImageDecoderCG::setData):
101         (WebCore::ImageDecoder::ImageDecoder): Deleted.
102         (WebCore::ImageDecoder::bytesDecodedToDetermineProperties): Deleted.
103         (WebCore::ImageDecoder::uti const): Deleted.
104         (WebCore::ImageDecoder::filenameExtension const): Deleted.
105         (WebCore::ImageDecoder::encodedDataStatus const): Deleted.
106         (WebCore::ImageDecoder::frameCount const): Deleted.
107         (WebCore::ImageDecoder::repetitionCount const): Deleted.
108         (WebCore::ImageDecoder::hotSpot const): Deleted.
109         (WebCore::ImageDecoder::frameSizeAtIndex const): Deleted.
110         (WebCore::ImageDecoder::frameIsCompleteAtIndex const): Deleted.
111         (WebCore::ImageDecoder::frameOrientationAtIndex const): Deleted.
112         (WebCore::ImageDecoder::frameDurationAtIndex const): Deleted.
113         (WebCore::ImageDecoder::frameAllowSubsamplingAtIndex const): Deleted.
114         (WebCore::ImageDecoder::frameHasAlphaAtIndex const): Deleted.
115         (WebCore::ImageDecoder::frameBytesAtIndex const): Deleted.
116         (WebCore::ImageDecoder::createFrameImageAtIndex const): Deleted.
117         (WebCore::ImageDecoder::setData): Deleted.
118         * platform/graphics/cg/ImageDecoderCG.h:
119         (WebCore::ImageDecoderCG::create):
120         (WebCore::ImageDecoder::create): Deleted.
121         (WebCore::ImageDecoder::isSizeAvailable): Deleted.
122         (WebCore::ImageDecoder::isAllDataReceived const): Deleted.
123         (WebCore::ImageDecoder::clearFrameBufferCache): Deleted.
124         * platform/graphics/win/ImageDecoderDirect2D.cpp:
125         (WebCore::ImageDecoderDirect2D::ImageDecoderDirect2D):
126         (WebCore::ImageDecoderDirect2D::systemImagingFactory):
127         (WebCore::ImageDecoderDirect2D::bytesDecodedToDetermineProperties):
128         (WebCore::ImageDecoderDirect2D::filenameExtension const):
129         (WebCore::ImageDecoderDirect2D::isSizeAvailable const):
130         (WebCore::ImageDecoderDirect2D::encodedDataStatus const):
131         (WebCore::ImageDecoderDirect2D::size const):
132         (WebCore::ImageDecoderDirect2D::frameCount const):
133         (WebCore::ImageDecoderDirect2D::repetitionCount const):
134         (WebCore::ImageDecoderDirect2D::hotSpot const):
135         (WebCore::ImageDecoderDirect2D::frameSizeAtIndex const):
136         (WebCore::ImageDecoderDirect2D::frameIsCompleteAtIndex const):
137         (WebCore::ImageDecoderDirect2D::frameOrientationAtIndex const):
138         (WebCore::ImageDecoderDirect2D::frameDurationAtIndex const):
139         (WebCore::ImageDecoderDirect2D::frameAllowSubsamplingAtIndex const):
140         (WebCore::ImageDecoderDirect2D::frameHasAlphaAtIndex const):
141         (WebCore::ImageDecoderDirect2D::frameBytesAtIndex const):
142         (WebCore::ImageDecoderDirect2D::setTargetContext):
143         (WebCore::ImageDecoderDirect2D::createFrameImageAtIndex const):
144         (WebCore::ImageDecoderDirect2D::setData):
145         * platform/graphics/win/ImageDecoderDirect2D.h:
146         (WebCore::ImageDecoderDirect2D::create):
147         (WebCore::ImageDecoder::create): Deleted.
148         (WebCore::ImageDecoder::isAllDataReceived const): Deleted.
149         (WebCore::ImageDecoder::clearFrameBufferCache): Deleted.
150         * platform/image-decoders/ScalableImageDecoder.cpp: Renamed from Source/WebCore/platform/image-decoders/ImageDecoder.cpp.
151         (WebCore::ScalableImageDecoder::create):
152         (WebCore::ScalableImageDecoder::frameIsCompleteAtIndex const):
153         (WebCore::ScalableImageDecoder::frameHasAlphaAtIndex const):
154         (WebCore::ScalableImageDecoder::frameBytesAtIndex const):
155         (WebCore::ScalableImageDecoder::frameDurationAtIndex const):
156         (WebCore::ScalableImageDecoder::createFrameImageAtIndex):
157         (WebCore::ScalableImageDecoder::prepareScaleDataIfNecessary):
158         (WebCore::ScalableImageDecoder::upperBoundScaledX):
159         (WebCore::ScalableImageDecoder::lowerBoundScaledX):
160         (WebCore::ScalableImageDecoder::upperBoundScaledY):
161         (WebCore::ScalableImageDecoder::lowerBoundScaledY):
162         (WebCore::ScalableImageDecoder::scaledY):
163         * platform/image-decoders/ScalableImageDecoder.h: Renamed from Source/WebCore/platform/image-decoders/ImageDecoder.h.
164         (WebCore::ScalableImageDecoder::ScalableImageDecoder):
165         (WebCore::ScalableImageDecoder::~ScalableImageDecoder):
166         (WebCore::ScalableImageDecoder::premultiplyAlpha const):
167         (WebCore::ScalableImageDecoder::isAllDataReceived const):
168         (WebCore::ScalableImageDecoder::size const):
169         (WebCore::ScalableImageDecoder::scaledSize):
170         (WebCore::ScalableImageDecoder::setSize):
171         (WebCore::ScalableImageDecoder::setIgnoreGammaAndColorProfile):
172         (WebCore::ScalableImageDecoder::ignoresGammaAndColorProfile const):
173         (WebCore::ScalableImageDecoder::rgbColorProfile):
174         (WebCore::ScalableImageDecoder::subsamplingLevelForScale):
175         (WebCore::ScalableImageDecoder::inputDeviceColorProfile):
176         (WebCore::ScalableImageDecoder::setFailed):
177         (WebCore::ScalableImageDecoder::failed const):
178         * platform/image-decoders/bmp/BMPImageDecoder.cpp:
179         (WebCore::BMPImageDecoder::BMPImageDecoder):
180         (WebCore::BMPImageDecoder::setData):
181         (WebCore::BMPImageDecoder::setFailed):
182         * platform/image-decoders/bmp/BMPImageDecoder.h:
183         * platform/image-decoders/bmp/BMPImageReader.h:
184         * platform/image-decoders/gif/GIFImageDecoder.cpp:
185         (WebCore::GIFImageDecoder::GIFImageDecoder):
186         (WebCore::GIFImageDecoder::setData):
187         (WebCore::GIFImageDecoder::setSize):
188         (WebCore::GIFImageDecoder::setFailed):
189         * platform/image-decoders/gif/GIFImageDecoder.h:
190         * platform/image-decoders/ico/ICOImageDecoder.cpp:
191         (WebCore::ICOImageDecoder::ICOImageDecoder):
192         (WebCore::ICOImageDecoder::setData):
193         (WebCore::ICOImageDecoder::size):
194         (WebCore::ICOImageDecoder::setSize):
195         (WebCore::ICOImageDecoder::setFailed):
196         * platform/image-decoders/ico/ICOImageDecoder.h:
197         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
198         (WebCore::JPEGImageDecoder::JPEGImageDecoder):
199         (WebCore::JPEGImageDecoder::setSize):
200         (WebCore::JPEGImageDecoder::setFailed):
201         * platform/image-decoders/jpeg/JPEGImageDecoder.h:
202         * platform/image-decoders/png/PNGImageDecoder.cpp:
203         (WebCore::PNGImageReader::decode):
204         (WebCore::PNGImageDecoder::PNGImageDecoder):
205         (WebCore::PNGImageDecoder::setSize):
206         (WebCore::PNGImageDecoder::frameBufferAtIndex):
207         (WebCore::PNGImageDecoder::setFailed):
208         * platform/image-decoders/png/PNGImageDecoder.h:
209         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
210         (WebCore::WEBPImageDecoder::WEBPImageDecoder):
211         (WebCore::WEBPImageDecoder::decode):
212         * platform/image-decoders/webp/WEBPImageDecoder.h:
213
214 2017-09-18  Andy Estes  <aestes@apple.com>
215
216         [Mac] Upstream miscellaneous WebKitSystemInterface functions
217         https://bugs.webkit.org/show_bug.cgi?id=177029
218
219         Reviewed by Alex Christensen.
220
221         * Configurations/WebCore.xcconfig: Used -force_load of libPAL instead of -ObjC. This forces
222         the linker to load both Objective-C and C PAL symbols in WebCore. This change is needed for
223         PAL::popUpMenu(), which is used by WebKit and WebKitLegacy but not WebCore.
224         * platform/cocoa/LocalizedStringsCocoa.mm:
225         (WebCore::contextMenuItemTagSearchWeb):
226         * platform/cocoa/ScrollController.mm:
227         (WebCore::elasticDeltaForTimeDelta):
228         (WebCore::elasticDeltaForReboundDelta):
229         (WebCore::reboundDeltaForElasticDelta):
230         * platform/graphics/ca/GraphicsLayerCA.cpp:
231         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
232         * platform/mac/CursorMac.mm:
233         (WebCore::WKCoreCursor_coreCursorType):
234         (WebCore::createCoreCursorClass):
235         (WebCore::coreCursorClass):
236         (WebCore::cursor):
237         (WebCore::Cursor::ensurePlatformCursor const):
238         * platform/mac/WebCoreSystemInterface.h:
239         * platform/mac/WebCoreSystemInterface.mm:
240         * rendering/RenderThemeMac.mm:
241         (WebCore::RenderThemeMac::paintTextArea):
242
243 2017-09-18  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
244
245         [Win][PAL] Move WebCoreHeaderDetection.h to PAL
246         https://bugs.webkit.org/show_bug.cgi?id=176990
247
248         Reviewed by Alex Christensen.
249
250         * PlatformWin.cmake:
251         Stop generating WebCoreHeaderDetection.h in WebCore.
252
253         * config.h:
254         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
255         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
256         Include PALHeaderDetection.h instead of WebCoreHeaderDetection.h
257
258 2017-09-18  Basuke Suzuki  <Basuke.Suzuki@sony.com>
259
260         [Curl] Create classes dedicated to handle SSL related tasks
261         and separate verifier and certificate management.
262         https://bugs.webkit.org/show_bug.cgi?id=176910
263
264         Reviewed by Alex Christensen.
265
266         * platform/Curl.cmake:
267         * platform/network/curl/CurlContext.cpp:
268         (WebCore::CurlContext::CurlContext):
269         (WebCore::CurlHandle::setCACertPath):
270         (WebCore::certificatePath): Deleted.
271         (WebCore::CurlHandle::enableCAInfoIfExists): Deleted.
272         (WebCore::CurlHandle::setSslErrors): Deleted.
273         (WebCore::CurlHandle::getSslErrors): Deleted.
274         * platform/network/curl/CurlContext.h:
275         (WebCore::CurlContext::sslHandle):
276         (WebCore::CurlContext::getCertificatePath const): Deleted.
277         (WebCore::CurlContext::shouldIgnoreSSLErrors const): Deleted.
278         * platform/network/curl/CurlDownload.cpp:
279         (WebCore::CurlDownload::setupRequest):
280         * platform/network/curl/CurlSSLHandle.cpp: Added.
281         (WebCore::CurlSSLHandle::CurlSSLHandle):
282         (WebCore::CurlSSLHandle::getCACertPathEnv):
283         (WebCore::CurlSSLHandle::setHostAllowsAnyHTTPSCertificate):
284         (WebCore::CurlSSLHandle::isAllowedHTTPSCertificateHost):
285         (WebCore::CurlSSLHandle::canIgnoredHTTPSCertificate):
286         (WebCore::CurlSSLHandle::setClientCertificateInfo):
287         (WebCore::CurlSSLHandle::getSSLClientCertificate):
288         * platform/network/curl/CurlSSLHandle.h: Renamed from Source/WebCore/platform/network/curl/SSLHandle.h.
289         (WebCore::CurlSSLHandle::shouldIgnoreSSLErrors const):
290         (WebCore::CurlSSLHandle::getCACertPath const):
291         * platform/network/curl/CurlSSLVerifier.cpp: Renamed from Source/WebCore/platform/network/curl/SSLHandle.cpp.
292         (WebCore::CurlSSLVerifier::setSslCtx):
293         (WebCore::CurlSSLVerifier::certVerifyCallback):
294         (WebCore::CurlSSLVerifier::getPemDataFromCtx):
295         (WebCore::CurlSSLVerifier::convertToSSLCertificateFlags):
296         * platform/network/curl/CurlSSLVerifier.h: Added.
297         (WebCore::CurlSSLVerifier::setCurlHandle):
298         (WebCore::CurlSSLVerifier::setHostName):
299         (WebCore::CurlSSLVerifier::sslErrors):
300         * platform/network/curl/ResourceHandleCurl.cpp:
301         (WebCore::ResourceHandle::setHostAllowsAnyHTTPSCertificate):
302         (WebCore::ResourceHandle::setClientCertificateInfo):
303         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
304         (WebCore::ResourceHandleCurlDelegate::ResourceHandleCurlDelegate):
305         (WebCore::ResourceHandleCurlDelegate::setupRequest):
306         (WebCore::ResourceHandleCurlDelegate::notifyFail):
307         (WebCore::ResourceHandleCurlDelegate::willSetupSslCtx):
308         (WebCore::ResourceHandleCurlDelegate::willSetupSslCtxCallback):
309         * platform/network/curl/ResourceHandleCurlDelegate.h:
310
311 2017-09-17  Carlos Garcia Campos  <cgarcia@igalia.com>
312
313         REGRESSION(r221974): [Harfbuzz] Test fast/text/international/hebrew-selection.html is failing since r221974
314         https://bugs.webkit.org/show_bug.cgi?id=177036
315
316         Reviewed by Michael Catanzaro.
317
318         In r221974 I rewrote the characterIndexForXPosition implementation without taking into account that there can be
319         multiple glyphs for the same character, so we can't simply do index++ and index-- to get the next and previous
320         character index.
321
322         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
323         (WebCore::HarfBuzzShaper::HarfBuzzRun::characterIndexForXPosition): Always get the character index from
324         m_glyphToCharacterIndexes array.
325
326 2017-09-17  Carlos Garcia Campos  <cgarcia@igalia.com>
327
328         [Harfbuzz] Test fast/text/complex-text-selection.html is failing since r222090
329         https://bugs.webkit.org/show_bug.cgi?id=177035
330
331         Reviewed by Michael Catanzaro.
332
333         The problem was not actually introduced in r222090, but revelaed by that change. The bug was added in r222086,
334         when adding the support for shaping a range of characters. We are not correctly filtering the characters in case
335         of rtl in some cases.
336
337         Fixes: fast/text/complex-text-selection.html
338
339         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
340         (WebCore::HarfBuzzShaper::fillGlyphBufferFromHarfBuzzRun): When checking if the current character is inside
341         the given range, continue or break the loop depending on whether text is rtl or not.
342
343 2017-09-16  Michael Catanzaro  <mcatanzaro@igalia.com>
344
345         [GTK] Build failure with enchant-2.1.1
346         https://bugs.webkit.org/show_bug.cgi?id=176877
347
348         Unreviewed build fix for enchant 2.1.1.
349
350         enchant_dict_free_suggestions() has been deprecated since at least 2005. Use its
351         replacement, enchant_dict_free_string_list(), instead. That's also been around since at
352         least 2005.
353
354         * platform/text/enchant/TextCheckerEnchant.cpp:
355         (WebCore::TextCheckerEnchant::getGuessesForWord):
356
357 2017-09-16  Antti Koivisto  <antti@apple.com>
358
359         Computing animated style should not require renderers
360         https://bugs.webkit.org/show_bug.cgi?id=171926
361         <rdar://problem/34428035>
362
363         Reviewed by Sam Weinig.
364
365         CSS animation system is now element rather than renderer based. This allows cleaning up
366         style resolution and render tree update code.
367
368         This also fixes bug animation doesn't run if display property is animated from one rendered type
369         to another. Added a test case for this.
370
371         Test: transitions/transition-display-property-2.html
372
373         * page/animation/CSSAnimationController.cpp:
374         (WebCore::CSSAnimationController::updateAnimations):
375
376             Pass in the old style instead of getting it from the renderer.
377             Factor to return the animated style as a return value.
378
379         * page/animation/CSSAnimationController.h:
380         * rendering/RenderElement.cpp:
381         (WebCore::RenderElement::RenderElement):
382         (WebCore::RenderElement::willBeDestroyed):
383
384             Animation are now canceled by RenderTreeUpdater::tearDownRenderers.
385
386         * rendering/RenderElement.h:
387         (WebCore::RenderElement::hasInitialAnimatedStyle const): Deleted.
388         (WebCore::RenderElement::setHasInitialAnimatedStyle): Deleted.
389
390             We no longer need to this concept.
391
392         * style/RenderTreeUpdater.cpp:
393         (WebCore::RenderTreeUpdater::updateElementRenderer):
394         (WebCore::RenderTreeUpdater::createRenderer):
395
396             We now get correct animated style from style resolution in all cases so we don't need to compute
397             it separately for new renderers.
398
399         (WebCore::RenderTreeUpdater::tearDownRenderers):
400
401             Cancel animations when render tree is fully torn down. Keep them when updating style.
402
403         * style/RenderTreeUpdater.h:
404         * style/StyleTreeResolver.cpp:
405         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
406
407             We can now compute animated style without renderer. Special cases dealing with rendererless case
408             can be removed.
409
410 2017-09-15  Carlos Garcia Campos  <cgarcia@igalia.com>
411
412         [Harbuzz] Test fast/text/international/harfbuzz-runs-with-no-glyph.html is crashing
413         https://bugs.webkit.org/show_bug.cgi?id=177005
414
415         Reviewed by Michael Catanzaro.
416
417         Fixes: fast/text/international/harfbuzz-runs-with-no-glyph.html
418
419         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
420         (WebCore::HarfBuzzShaper::HarfBuzzRun::xPositionForOffset): Return early if there aren't glyphs.
421
422 2017-09-15  Said Abou-Hallawa  <sabouhallawa@apple.com>
423
424         Avoid calling String::format() in PlatformCAFilters::setFiltersOnLayer()
425         https://bugs.webkit.org/show_bug.cgi?id=177028
426
427         Reviewed by Tim Horton.
428
429         String::format() is a bigger hammer for what we need to do in this function.
430
431         * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
432
433 2017-09-15  Ryosuke Niwa  <rniwa@webkit.org>
434
435         iOS: Use blob URL instead of a WebKit fake URL when pasting an image
436         https://bugs.webkit.org/show_bug.cgi?id=176986
437         <rdar://problem/34455052>
438
439         Reviewed by Wenson Hsieh.
440
441         Fixed the bug that pasting an image on iOS resulted in an img element with src attribute
442         set to a WebKit fake URL so that the Web content could never save it.
443
444         Like r208451 on Mac, use a Blob URL instead.
445
446         This patch also removes createFragmentForImageResourceAndAddResource since it's no longer used.
447
448         Tests: LayoutTests/editing/pasteboard/paste-image-as-blob-url.html
449
450         * editing/cocoa/WebContentReaderCocoa.mm:
451         (WebCore::WebContentReader::readImage): Moved the code here from WebContentReaderMac.mm.
452         * editing/ios/WebContentReaderIOS.mm:
453         (WebCore::WebContentReader::readImage): Deleted. This is the code 
454         * editing/mac/WebContentReaderMac.mm:
455         (WebCore::WebContentReader::readImage): Moved to WebContentReaderCocoa.mm. Note that
456         typeAsFilenameWithExtension was dead code after r208451
457         * editing/markup.cpp:
458         (WebCore::createFragmentForImageResourceAndAddResource): Deleted.
459         * editing/markup.h:
460
461 2017-09-15  Wenson Hsieh  <wenson_hsieh@apple.com>
462
463         Avoid style recomputation when forwarding a focus event to an text field's input type
464         https://bugs.webkit.org/show_bug.cgi?id=176160
465         <rdar://problem/34184820>
466
467         Reviewed by Ryosuke Niwa.
468
469         Currently, TextFieldInputType::forwardEvent synchronously triggers style recomputation, for the purpose of
470         scrolling to the origin upon handling a blur event, and also for updating caps lock state after a blur or focus.
471         In synchronously triggering style recomputation, we may end up running arbitrary JavaScript, which may change
472         the HTMLInputElement's type and cause the current TextFieldInputType to be destroyed.
473
474         To mitigate this, we only update caps lock state when forwarding a focus or blur event to the InputType, and
475         instead scroll blurred text fields to the origin later, in HTMLInputElement::didBlur (invoked from
476         Document::setFocusedElement after blur and focusout events have fired). Instead of having the InputType update
477         style, lift the call to Document::updateStyleIfNeeded up into HTMLInputElement so that we gracefully handle the
478         case where the page destroys and sets a new InputType within the scope of this style update.
479
480         Test: fast/forms/change-input-type-in-focus-handler.html
481
482         * dom/Document.cpp:
483         (WebCore::Document::setFocusedElement):
484         * html/HTMLInputElement.cpp:
485         (WebCore::HTMLInputElement::didBlur):
486         * html/HTMLInputElement.h:
487         * html/InputType.h:
488         (WebCore::InputType::elementDidBlur):
489         * html/TextFieldInputType.cpp:
490         (WebCore::TextFieldInputType::forwardEvent):
491         (WebCore::TextFieldInputType::elementDidBlur):
492         * html/TextFieldInputType.h:
493
494 2017-09-15  JF Bastien  <jfbastien@apple.com>
495
496         WTF: use Forward.h when appropriate instead of Vector.h
497         https://bugs.webkit.org/show_bug.cgi?id=176984
498
499         Reviewed by Saam Barati.
500
501         There's no need to include Vector.h when Forward.h will suffice. All we need is to move the template default parameters from Vector, and then the forward declaration can be used in so many new places: if a header only takes Vector by reference, rvalue reference, pointer, returns any of these, or has them as members then the header doesn't need to see the definition because the declaration will suffice.
502
503         * Modules/entriesapi/FileSystemEntriesCallback.h:
504         * Modules/indexeddb/IDBEventDispatcher.h:
505         * Modules/indexeddb/IDBFactory.h:
506         * Modules/indexeddb/client/IDBConnectionProxy.h:
507         * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
508         * Modules/webdatabase/DatabaseTask.h:
509         * Modules/websockets/WebSocketChannelClient.h:
510         * contentextensions/CombinedURLFilters.h:
511         * crypto/SerializedCryptoKeyWrap.h:
512         * css/InspectorCSSOMWrappers.h:
513         * css/PageRuleCollector.h:
514         * css/parser/CSSParserTokenRange.h:
515         * dom/DocumentTouch.h:
516         * dom/MutationCallback.h:
517         * editing/EditingStyle.h:
518         * editing/SpellChecker.h:
519         * editing/markup.h:
520         * fileapi/ThreadableBlobRegistry.h:
521         * html/FileListCreator.h:
522         * inspector/WebHeapAgent.h:
523         * loader/ContentFilter.cpp:
524         (WebCore::ContentFilter::ContentFilter):
525         * loader/ContentFilter.h:
526         * loader/CookieJar.h:
527         * loader/FrameLoaderClient.h:
528         * loader/LoaderStrategy.h:
529         * loader/SubframeLoader.h:
530         * page/ChromeClient.h:
531         * page/FrameSnapshotting.h:
532         * page/IntersectionObserverCallback.h:
533         * page/PageSerializer.h:
534         * page/UserContentURLPattern.h:
535         * page/scrolling/AxisScrollSnapOffsets.h:
536         * page/win/FrameWin.h:
537         * platform/CookiesStrategy.h:
538         * platform/KeyedCoding.h:
539         * platform/PasteboardStrategy.h:
540         * platform/SSLKeyGenerator.h:
541         * platform/ScrollableArea.h:
542         * platform/encryptedmedia/CDMFactory.h:
543         * platform/gamepad/EmptyGamepadProvider.cpp:
544         * platform/gamepad/GamepadProvider.h:
545         * platform/gamepad/GamepadProviderClient.h:
546         * platform/gamepad/PlatformGamepad.h:
547         * platform/graphics/GeometryUtilities.cpp:
548         * platform/graphics/GeometryUtilities.h:
549         * platform/graphics/Icon.h:
550         * platform/graphics/LayoutRect.h:
551         * platform/graphics/Path.h:
552         * platform/graphics/WOFFFileFormat.h:
553         * platform/graphics/avfoundation/MediaSampleAVFObjC.h:
554         * platform/graphics/avfoundation/objc/AVAssetTrackUtilities.h:
555         * platform/graphics/ca/PlatformCAAnimation.h:
556         * platform/graphics/ca/win/PlatformCALayerWinInternal.h:
557         * platform/graphics/opentype/OpenTypeMathData.h:
558         * platform/image-encoders/JPEGImageEncoder.h:
559         * platform/image-encoders/PNGImageEncoder.h:
560         * platform/network/BlobRegistry.h:
561         * platform/network/HTTPParsers.h:
562         * platform/network/PlatformCookieJar.h:
563         * platform/network/cf/DownloadBundle.h:
564         * platform/network/curl/CurlCacheEntry.h:
565         * platform/network/curl/DownloadBundle.h:
566         * platform/text/LineEnding.h:
567         * platform/text/QuotedPrintable.cpp:
568         * platform/text/QuotedPrintable.h:
569         * rendering/FlexibleBoxAlgorithm.h:
570         * rendering/style/QuotesData.h:
571         * rendering/svg/SVGSubpathData.h:
572         * storage/StorageEventDispatcher.h:
573         * style/StyleInvalidator.h:
574         * style/StyleRelations.h:
575         * svg/SVGAltGlyphDefElement.h:
576         * svg/SVGAltGlyphItemElement.h:
577
578 2017-09-15  Youenn Fablet  <youenn@apple.com>
579
580         ASSERTION FAILED: writtenAudioDuration >= readAudioDuration in com.apple.WebCore:WebCore::RealtimeOutgoingAudioSource::isReachingBufferedAudioDataHighLimit() + 222
581         https://bugs.webkit.org/show_bug.cgi?id=175164
582         <rdar://problem/33712305>
583
584         Reviewed by Eric Carlson.
585
586         No observable change of behavior.
587
588         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
589         (WebCore::RealtimeOutgoingAudioSource::hasBufferedEngouhData):
590         (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable): Calling pullData only if there is at least 0.01 seconds of available data.
591         * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
592
593 2017-09-15  Youenn Fablet  <youenn@apple.com>
594
595         Move code using Vector::map to WTF:map
596         https://bugs.webkit.org/show_bug.cgi?id=176860
597
598         Reviewed by Jer Noble.
599
600         No change of behavior.
601
602         * loader/FormSubmission.cpp:
603         (WebCore::FormSubmission::create): Moving to WTF::map.
604         * page/Settings.cpp:
605         (WebCore::Settings::setMediaContentTypesRequiringHardwareSupport): Using iterator split to not create a temporary vector.
606         * platform/ContentType.cpp:
607         (WebCore::ContentType::ContentType):
608         (WebCore::splitParameters):
609         (WebCore::ContentType::codecs const): Ditto.
610         (WebCore::ContentType::profiles const): Ditto.
611         (WebCore::stripHTMLWhiteSpace): Deleted.
612         * platform/ContentType.h:
613         (WebCore::ContentType::create): Deleted.
614         * platform/graphics/MediaPlayer.cpp:
615         (WebCore::MediaPlayer::load): Minor count churning change.
616
617 2017-09-15  Youenn Fablet  <youenn@apple.com>
618
619         MediaPlayerPrivateMediaStreamAVFObjC::requestNotificationWhenReadyForVideoData should enqueue data if still useful
620         https://bugs.webkit.org/show_bug.cgi?id=177016
621
622         Reviewed by Jer Noble.
623
624         No change of behavior.
625
626         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
627         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::requestNotificationWhenReadyForVideoData): exciting early in block to prevent enqueueing.
628
629 2017-09-15  Ryan Haddad  <ryanhaddad@apple.com>
630
631         Unreviewed, rolling out r222040.
632
633         The LayoutTest added with this change is a flaky image failure
634         on mac-wk1 debug bots.
635
636         Reverted changeset:
637
638         "Computing animated style should not require renderers"
639         https://bugs.webkit.org/show_bug.cgi?id=171926
640         http://trac.webkit.org/changeset/222040
641
642 2017-09-15  Tim Horton  <timothy_horton@apple.com>
643
644         Fix the macOS CMake build
645         https://bugs.webkit.org/show_bug.cgi?id=177015
646
647         Reviewed by Andy Estes.
648
649         * CMakeLists.txt:
650         Add Payment Request files.
651
652         * PlatformMac.cmake:
653         Add the CoreServices umbrella framework to the framework search path.
654         Add service workers directories to the forwarding headers path.
655         Add Modules/cache directory to the forwarding headers path.
656
657         * rendering/svg/RenderSVGRoot.cpp:
658         (WebCore::resolveLengthAttributeForSVG): Deleted unused function.
659
660 2017-09-15  John Wilander  <wilander@apple.com>
661
662         Storage Access API: Deny access to nested iframes
663         https://bugs.webkit.org/show_bug.cgi?id=176939
664         <rdar://problem/34439609>
665
666         Reviewed by Brent Fulgham.
667
668         Test: http/tests/storageAccess/request-and-grant-storage-access-cross-origin-sandboxed-nested-iframe.html
669
670         * dom/Document.cpp:
671         (WebCore::Document::requestStorageAccess):
672
673 2017-09-15  Antti Koivisto  <antti@apple.com>
674
675         AnimationBase should ref the element
676         https://bugs.webkit.org/show_bug.cgi?id=176993
677
678         Reviewed by Simon Fraser.
679
680         We now longer have renderer pointer. Element can be reffed for safety.
681
682         This doesn't create reference cycle as the element pointer is cleared when render tree is
683         torn down. This happens at the latest when the element is removed from the tree.
684
685         * page/animation/AnimationBase.cpp:
686         (WebCore::AnimationBase::~AnimationBase):
687         (WebCore::AnimationBase::clear):
688         * page/animation/AnimationBase.h:
689         (WebCore::AnimationBase::~AnimationBase): Deleted.
690         (WebCore::AnimationBase::clear): Deleted.
691         * page/animation/ImplicitAnimation.cpp:
692         (WebCore::ImplicitAnimation::pauseAnimation):
693         (WebCore::ImplicitAnimation::sendTransitionEvent):
694         (WebCore::ImplicitAnimation::reset):
695         * page/animation/KeyframeAnimation.cpp:
696         (WebCore::KeyframeAnimation::pauseAnimation):
697         (WebCore::KeyframeAnimation::endAnimation):
698         (WebCore::KeyframeAnimation::sendAnimationEvent):
699         (WebCore::KeyframeAnimation::resolveKeyframeStyles):
700
701 2017-09-15  Brent Fulgham  <bfulgham@apple.com>
702
703         Make DocumentLoader a FrameDestructionObserver
704         https://bugs.webkit.org/show_bug.cgi?id=176364
705         <rdar://problem/34254780>
706
707         Reviewed by Alex Christensen.
708
709         The DocumentLoader needs to know when its Frame is destroyed so that it can
710         perform properly cleanup.
711
712         Test: fast/events/beforeunload-dom-manipulation-crash.html
713
714         * loader/DocumentLoader.cpp:
715         (WebCore::DocumentLoader::DocumentLoader): Call FrameDestructionObserver constructor.
716         (WebCore::DocumentLoader::responseReceived): Drive-by fix. Make sure the current
717         object is valid during the callback.
718         (WebCore::DocumentLoader::attachToFrame): Use FrameDestructionObserver::observerFrame rather
719         than setting the m_frame variable directly.
720         (WebCore::DocumentLoader::detachFromFrame): Ditto.
721         * loader/DocumentLoader.h:
722         (WebCore::DocumentLoader::frame const): Deleted, as this is provided by the FrameDestructionObserver.
723
724 2017-09-15  Ms2ger  <Ms2ger@igalia.com>
725
726         Update some WebGL2 return types to match the specification.
727         https://bugs.webkit.org/show_bug.cgi?id=176996
728
729         Reviewed by Alex Christensen.
730
731         This should not change the behavior in any way, but it makes it simpler
732         to compare our IDL with the specification's.
733
734         No new tests because there is no behavior change.
735
736         * html/canvas/WebGL2RenderingContext.cpp:
737         (WebCore::WebGL2RenderingContext::getUniformIndices):
738         * html/canvas/WebGL2RenderingContext.h:
739         * html/canvas/WebGL2RenderingContext.idl:
740
741 2017-09-15  Antti Koivisto  <antti@apple.com>
742
743         Remove FilterOperation::blendingNeedsRendererSize()
744         https://bugs.webkit.org/show_bug.cgi?id=176994
745
746         Reviewed by Simon Fraser.
747
748         It is not used.
749
750         * page/animation/CSSPropertyAnimation.cpp:
751         (WebCore::blendFunc):
752         * platform/graphics/filters/FilterOperation.h:
753         (WebCore::FilterOperation::blend):
754         (WebCore::FilterOperation::shouldBeRestrictedBySecurityOrigin const):
755         (WebCore::FilterOperation::blendingNeedsRendererSize const): Deleted.
756
757 2017-09-15  Youenn Fablet  <youenn@apple.com>
758
759         Add an URL method to remove both query string and fragment identifier
760         https://bugs.webkit.org/show_bug.cgi?id=176911
761
762         Reviewed by Alex Christensen.
763
764         Covered by existing tests and new API tests.
765
766         * Modules/cache/DOMCache.cpp:
767         (WebCore::DOMCache::retrieveRecords): Using new helper method.
768         * platform/URL.cpp:
769         (WebCore::URL::removeQueryAndFragmentIdentifier):
770         * platform/URL.h:
771
772 2017-09-15  Andy Estes  <aestes@apple.com>
773
774         [Cocoa] Upstream MediaRemote and VideoToolbox WebKitSystemInterface functions
775         https://bugs.webkit.org/show_bug.cgi?id=176953
776
777         Reviewed by Eric Carlson.
778
779         * platform/cocoa/VideoToolboxSoftLink.cpp:
780         * platform/cocoa/VideoToolboxSoftLink.h:
781         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
782         (WebCore::queryDecoderAvailability):
783         (WebCore::CDMPrivateMediaSourceAVFObjC::supportsKeySystem):
784         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
785         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetType const):
786         (WebCore::exernalDeviceDisplayNameForPlayer):
787         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetName const):
788         * platform/ios/WebCoreSystemInterfaceIOS.mm:
789         * platform/mac/MediaRemoteSoftLink.cpp:
790         * platform/mac/MediaRemoteSoftLink.h:
791         * platform/mac/WebCoreSystemInterface.h:
792         * platform/mac/WebCoreSystemInterface.mm:
793
794 2017-09-15  Eric Carlson  <eric.carlson@apple.com>
795
796         Switch text tracks to release logging
797         https://bugs.webkit.org/show_bug.cgi?id=176809
798         <rdar://problem/34397605>
799
800         Reviewed by Jer Noble.
801
802         Make all track objects use the same logger and log identifier as the media element they
803         "belong" to. Convert all track logging from debug-only to release logging.
804
805         * WebCore.xcodeproj/project.pbxproj:
806         * html/HTMLMediaElement.cpp:
807         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
808         * html/HTMLMediaElement.h:
809         * html/track/AudioTrack.cpp:
810         (WebCore::AudioTrack::AudioTrack):
811         (WebCore::AudioTrack::setPrivate):
812         (WebCore::AudioTrack::setMediaElement):
813         * html/track/AudioTrack.h:
814         * html/track/DataCue.cpp:
815         (WebCore::DataCue::toString const):
816         * html/track/DataCue.h:
817         (PAL::LogArgument<WebCore::DataCue>::toString):
818         * html/track/InbandDataTextTrack.cpp:
819         (WebCore::InbandDataTextTrack::addDataCue):
820         (WebCore::InbandDataTextTrack::updateDataCue):
821         (WebCore::InbandDataTextTrack::removeDataCue):
822         * html/track/InbandDataTextTrack.h:
823         * html/track/InbandGenericTextTrack.cpp:
824         (WebCore::InbandGenericTextTrack::addGenericCue):
825         (WebCore::InbandGenericTextTrack::removeGenericCue):
826         (WebCore::InbandGenericTextTrack::newCuesParsed):
827         (WebCore::InbandGenericTextTrack::fileFailedToParse):
828         * html/track/InbandGenericTextTrack.h:
829         * html/track/InbandTextTrack.cpp:
830         (WebCore::InbandTextTrack::InbandTextTrack):
831         (WebCore::InbandTextTrack::setMediaElement):
832         * html/track/InbandTextTrack.h:
833         * html/track/InbandWebVTTTextTrack.cpp:
834         (WebCore::InbandWebVTTTextTrack::newCuesParsed):
835         (WebCore::InbandWebVTTTextTrack::fileFailedToParse):
836         * html/track/InbandWebVTTTextTrack.h:
837         * html/track/LoadableTextTrack.cpp:
838         (WebCore::LoadableTextTrack::newCuesAvailable):
839         (WebCore::LoadableTextTrack::cueLoadingCompleted):
840         * html/track/LoadableTextTrack.h:
841         * html/track/TextTrack.cpp:
842         (WebCore::TextTrack::addCue):
843         (WebCore::TextTrack::removeCue):
844         (WebCore::TextTrack::setLanguage):
845         * html/track/TextTrack.h:
846         * html/track/TextTrackCue.cpp:
847         (WebCore::TextTrackCue::toString const):
848         * html/track/TextTrackCue.h:
849         (PAL::LogArgument<WebCore::TextTrackCue>::toString):
850         * html/track/TextTrackCueGeneric.cpp:
851         (WebCore::TextTrackCueGeneric::setFontSize):
852         (WebCore::TextTrackCueGeneric::toString const):
853         * html/track/TextTrackCueGeneric.h:
854         (PAL::LogArgument<WebCore::TextTrackCueGeneric>::toString):
855         * html/track/TrackBase.cpp:
856         (WebCore::nextLogIdentifier):
857         (WebCore::nullLogger):
858         (WebCore::TrackBase::TrackBase):
859         (WebCore::TrackBase::setMediaElement):
860         (WebCore::TrackBase::logChannel const):
861         (WebCore::TrackBase::~TrackBase): Deleted.
862         * html/track/TrackBase.h:
863         (WebCore::TrackBase::setMediaElement): Deleted.
864         * html/track/VTTCue.cpp:
865         (WebCore::VTTCue::setFontSize):
866         (WebCore::VTTCue::toString const):
867         * html/track/VTTCue.h:
868         (PAL::LogArgument<WebCore::VTTCue>::toString):
869         * html/track/VideoTrack.cpp:
870         (WebCore::VideoTrack::VideoTrack):
871         (WebCore::VideoTrack::setPrivate):
872         (WebCore::VideoTrack::setMediaElement):
873         * html/track/VideoTrack.h:
874         * platform/graphics/AudioTrackPrivate.h:
875         * platform/graphics/InbandTextTrackPrivate.h:
876         (WebCore::InbandTextTrackPrivate::setClient):
877         * platform/graphics/InbandTextTrackPrivateClient.h:
878         (WebCore::GenericCueData::toString const):
879         (PAL::LogArgument<WebCore::GenericCueData>::toString):
880         * platform/graphics/TrackPrivateBase.cpp: Added.
881         (WebCore::TrackPrivateBase::setLogger):
882         (WebCore::TrackPrivateBase::logChannel const):
883         * platform/graphics/TrackPrivateBase.h:
884         * platform/graphics/VideoTrackPrivate.h:
885         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
886         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp:
887         (WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes):
888         (WebCore::InbandMetadataTextTrackPrivateAVF::flushPartialCues):
889         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h:
890         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
891         (WebCore::InbandTextTrackPrivateAVF::processAttributedStrings):
892         (WebCore::InbandTextTrackPrivateAVF::removeCompletedCues):
893         (WebCore::InbandTextTrackPrivateAVF::resetCueValues):
894         (WebCore::InbandTextTrackPrivateAVF::processNativeSamples):
895         (WebCore::InbandTextTrackPrivateAVF::readNativeSampleBuffer):
896         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.h:
897         * platform/graphics/avfoundation/objc/AudioTrackPrivateAVFObjC.mm:
898         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
899         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
900         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
901         (WebCore::AudioTrackPrivateMediaStreamCocoa::createAudioUnit):
902         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
903
904 2017-09-15  Carlos Garcia Campos  <cgarcia@igalia.com>
905
906         [Harfbuzz] Material icons not rendered correctly when using the web font
907         https://bugs.webkit.org/show_bug.cgi?id=176995
908
909         Reviewed by Michael Catanzaro.
910
911         Only a few of them are correctly rendered and some others are wrong. We only render correctly the ones that
912         don't have an underscore in their name (or that start with a number like 3d_rotation). In the cases where the
913         name before the underscore is also an icon, we render that icon instead, that's why some of them are wrong. This
914         is happening because the underscore is causing the HarfbuffShaper to split the text in 3 runs, one for the word
915         before the underscore, another one for the underscore and another for the word after the underscore. So, we
916         end up trying to shape the 3 runs independently and we fail when the icon doesn't exist, or when it exists but
917         it's not the one we are looking for. The cause of this is that the underscore has a different script (Common)
918         than the rest of characters (Latin) which is a condition in HarfbuffShaper to create a different run. The
919         unicode spec says that characters with Common script should be handled differently, but we are just ignoring
920         it. The spec proposes to use an heuristic based on simply inheriting the script of the previous character, which
921         should work in most of the cases. We could take a more conservative approach and do that only if both characters
922         are ASCII. We should also consider handling other cases mentioned by the spec like brackets and quotation marks,
923         but that belongs to a different bug/commit.
924
925         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
926         (WebCore::scriptsAreCompatibleForCharacters): Helper function to check if the current and previous scripts are
927         compatible,
928         (WebCore::HarfBuzzShaper::collectHarfBuzzRuns): Use scriptsAreCompatibleForCharacters() to decided whether to
929         finish the current run or not. In case of Common script, inherit also the script from the previous character.
930
931 2017-09-15  Carlos Garcia Campos  <cgarcia@igalia.com>
932
933         [Harfbuzz] Fix incorrect font rendering when selecting texts in pages which specifies text-rendering: optimizeLegibility
934         https://bugs.webkit.org/show_bug.cgi?id=148220
935
936         Reviewed by Michael Catanzaro.
937
938         Add support for shaping a range of characters and return the advance to the first glyph in the range.
939
940         Covered by existing tests.
941
942         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
943         (WebCore::FontCascade::getGlyphsAndAdvancesForComplexText const): Pass "from" and "to" parameters to
944         HarfBuzzShaper::shape and return the x position of the selection rect.
945         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
946         (WebCore::HarfBuzzShaper::shape): Forward "from" and "to" parameters to fillGlyphBuffer().
947         (WebCore::HarfBuzzShaper::fillGlyphBufferFromHarfBuzzRun): Only add glyphs for the given character range.
948         (WebCore::HarfBuzzShaper::fillGlyphBuffer): Only consider runs in the given character range.
949         * platform/graphics/harfbuzz/HarfBuzzShaper.h:
950
951 2017-09-15  Zan Dobersek  <zdobersek@igalia.com>
952
953         [EME] ClearKey: list 'persistent-license' sessions as supported
954         https://bugs.webkit.org/show_bug.cgi?id=176985
955
956         Reviewed by Xabier Rodriguez-Calvar.
957
958         The ClearKey implementation should support the 'persistent-license'
959         session type for testing purposes. Methods in the CDMPrivateClearKey
960         class have been updated to handle that session type as supported:
961         - supportsSessionTypeWithConfiguration() returns true for the
962           'persistent-license' session type values,
963         - supportsConfiguration() allows persistent state as required in
964           case of the configured session type being 'persistent-license',
965         - supportsConfigurationWithRestrictions() as well allows persistent
966         state as required for 'persistent-license' session types.
967
968         No new tests -- affected tests have their baselines updated.
969
970         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
971         (WebCore::CDMPrivateClearKey::supportsConfiguration const):
972         (WebCore::CDMPrivateClearKey::supportsConfigurationWithRestrictions const):
973         (WebCore::CDMPrivateClearKey::supportsSessionTypeWithConfiguration const):
974
975 2017-09-15  Ms2ger  <Ms2ger@igalia.com>
976
977         Disallow passing a null program to getFragDataLocation.
978         https://bugs.webkit.org/show_bug.cgi?id=176895
979
980         Reviewed by Sam Weinig.
981
982         This matches the specification as well as Gecko and Chromium.
983
984         Test: fast/canvas/webgl/webgl2/bindings.html
985
986         * html/canvas/WebGL2RenderingContext.cpp:
987         (WebCore::WebGL2RenderingContext::getFragDataLocation):
988         * html/canvas/WebGL2RenderingContext.h:
989         * html/canvas/WebGL2RenderingContext.idl:
990
991 2017-09-14  Carlos Garcia Campos  <cgarcia@igalia.com>
992
993         [FreeType] Complex text is enabled too often after r221909
994         https://bugs.webkit.org/show_bug.cgi?id=176907
995
996         Reviewed by Sergio Villar Senin.
997
998         In r221909 we enabled complex text by default following the same cocoa ifdefs, but I forgot another ifdef in the
999         cpp file.
1000
1001         * platform/graphics/FontCascade.cpp:
1002         (WebCore::FontCascade::codePath const):
1003
1004 2017-09-14  Commit Queue  <commit-queue@webkit.org>
1005
1006         Unreviewed, rolling out r221932 and r221933.
1007         https://bugs.webkit.org/show_bug.cgi?id=176969
1008
1009         This change did not fix the webgl test flakiness. (Requested
1010         by ryanhaddad on #webkit).
1011
1012         Reverted changesets:
1013
1014         "[WebGL] accelerated texImage2D for video doesn't respect
1015         flipY"
1016         https://bugs.webkit.org/show_bug.cgi?id=176491
1017         http://trac.webkit.org/changeset/221932
1018
1019         "[WebGL] VideoTextureCopierCV doesn't correctly restore vertex
1020         attribute state"
1021         https://bugs.webkit.org/show_bug.cgi?id=176771
1022         http://trac.webkit.org/changeset/221933
1023
1024 2017-09-14  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1025
1026         [Curl] Replace the implementation with NetworkLoadMetrics
1027         https://bugs.webkit.org/show_bug.cgi?id=176906
1028
1029         Reviewed by Alex Christensen.
1030
1031         * platform/network/curl/CurlContext.cpp:
1032         (WebCore::CurlHandle::getEffectiveURL):
1033         (WebCore::CurlHandle::getPrimaryPort):
1034         (WebCore::CurlHandle::getResponseCode):
1035         (WebCore::CurlHandle::getContentLenghtDownload):
1036         (WebCore::CurlHandle::getHttpAuthAvail):
1037         (WebCore::CurlHandle::getTimes):
1038         (WebCore::CurlHandle::getEffectiveURL const): Deleted.
1039         * platform/network/curl/CurlContext.h:
1040         * platform/network/curl/CurlDownload.cpp:
1041         (WebCore::CurlDownload::didReceiveHeader):
1042         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
1043         (WebCore::ResourceHandleCurlDelegate::dispatchSynchronousJob):
1044         (WebCore::ResourceHandleCurlDelegate::notifyFinish):
1045         (WebCore::ResourceHandleCurlDelegate::getProtectionSpace):
1046         (WebCore::ResourceHandleCurlDelegate::didReceiveAllHeaders):
1047         (WebCore::ResourceHandleCurlDelegate::handleLocalReceiveResponse):
1048         (WebCore::ResourceHandleCurlDelegate::didFinish):
1049         (WebCore::ResourceHandleCurlDelegate::getNetworkLoadMetrics):
1050         (WebCore::ResourceHandleCurlDelegate::didReceiveHeader):
1051         (WebCore::ResourceHandleCurlDelegate::didReceiveData):
1052         (WebCore::ResourceHandleCurlDelegate::setWebTimings): Deleted.
1053         * platform/network/curl/ResourceHandleCurlDelegate.h:
1054         * platform/network/curl/ResourceResponse.h:
1055         (WebCore::ResourceResponse::setDeprecatedNetworkLoadMetrics):
1056
1057 2017-09-14  Daniel Bates  <dabates@apple.com>
1058
1059         [Mac] Spelling, grammar and correction dots are painted upside down
1060         https://bugs.webkit.org/show_bug.cgi?id=176949
1061         <rdar://problem/34441098>
1062
1063         Reviewed by Simon Fraser.
1064
1065         Painting occurs in a vertically flipped context. Vertically flip the context ("unflip" it)
1066         before painting the document markers on macOS so that they are painted right-side. This makes
1067         the appearance of spelling, grammar and correction dots in WebKit match the AppKit appearance
1068         of these dots.
1069
1070         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
1071         (WebCore::GraphicsContext::drawLineForDocumentMarker): Flip the context as described above.
1072         Also make use of RAII object CGContextStateSaver instead of manually saving and restoring
1073         the state of the context.
1074
1075 2017-09-14  Joseph Pecoraro  <pecoraro@apple.com>
1076
1077         Unreviewed rollout r222036.
1078         
1079         The LayoutTests added with this change is flaky.
1080
1081         Reverted changeset
1082         Web Inspector: Timeline should show when events preventDefault() was called on an event or not
1083         https://bugs.webkit.org/show_bug.cgi?id=176824
1084         http://trac.webkit.org/changeset/222036
1085
1086 2017-09-14  Ryosuke Niwa  <rniwa@webkit.org>
1087
1088         WebContentReader::readWebArchive doesn't need to handle image MIME type
1089         https://bugs.webkit.org/show_bug.cgi?id=176884
1090
1091         Reviewed by Sam Weinig.
1092
1093         Remove the code to handle image MIME types in the web archive on macOS since we have a separate code path
1094         to handle images in the pasteboard directly. As far as I can tell, this code is never used in practice.
1095
1096         This allows merging iOS and macOS code to read web archive from the pasteboard. Also merged member functions
1097         for handling RTFD and RTF in iOS and macOS in WebContentReaderCocoa.mm.
1098
1099         * CMakeLists.txt:
1100         * WebCore.xcodeproj/project.pbxproj:
1101         * editing/WebContentReader.cpp: Added.
1102         (WebCore::WebContentReader::addFragment): Moved from WebContentReaderIOS.mm and simplified since appendChild
1103         knows how to add a DocumentFragment.
1104         * editing/WebContentReader.h:
1105         * editing/cocoa/WebContentReaderCocoa.mm:
1106         (WebCore::createFragmentAndAddResources):
1107         (WebCore::WebContentReader::readWebArchive): Merged iOS / macOS code here.
1108         (WebCore::WebContentReader::readRTFD): Ditto.
1109         (WebCore::WebContentReader::readRTF): Ditto.
1110         (WebCore::WebContentReader::readPlainText): Ditto.
1111         * editing/ios/EditorIOS.mm:
1112         (WebCore::Editor::pasteWithPasteboard):
1113         * editing/ios/WebContentReaderIOS.mm:
1114         (WebCore::WebContentReader::readImage):
1115         (WebCore::WebContentReader::readURL):
1116         (WebCore::WebContentReader::readWebArchive): Moved to WebContentReaderCocoa.mm.
1117         (WebCore::WebContentReader::readRTFD): Ditto.
1118         (WebCore::WebContentReader::readRTF): Ditto.
1119         (WebCore::WebContentReader::readPlainText): Ditto.
1120         * editing/mac/WebContentReaderMac.mm:
1121         (WebCore::WebContentReader::readWebArchive): Ditto.
1122         (WebCore::WebContentReader::readRTFD): Ditto.
1123         (WebCore::WebContentReader::readRTF): Ditto.
1124
1125 2017-09-14  Devin Rousso  <webkit@devinrousso.com>
1126
1127         Web Inspector: make recording swizzle async
1128         https://bugs.webkit.org/show_bug.cgi?id=176936
1129
1130         Reviewed by Joseph Pecoraro.
1131
1132         * inspector/InspectorCanvas.cpp:
1133         (WebCore::InspectorCanvas::buildArrayForCanvasPattern):
1134         (WebCore::InspectorCanvas::buildAction):
1135         For objects that are not able to be stringified (e.g. elements), send a deduplicated string
1136         with the name of the object as a placeholder value (e.g. "Element").
1137
1138 2017-09-14  Andy Estes  <aestes@apple.com>
1139
1140         [Mac] Upstream SpeechSynthesis-related WebKitSystemInterface functions
1141         https://bugs.webkit.org/show_bug.cgi?id=176931
1142
1143         Reviewed by Joseph Pecoraro.
1144
1145         * platform/mac/PlatformSpeechSynthesizerMac.mm:
1146         (WebCore::speechSynthesisGetVoiceIdentifiers):
1147         (WebCore::speechSynthesisGetDefaultVoiceIdentifierForLocale):
1148         (WebCore::PlatformSpeechSynthesizer::initializeVoiceList):
1149         * platform/mac/WebCoreSystemInterface.h:
1150         * platform/mac/WebCoreSystemInterface.mm:
1151
1152 2017-09-14  Youenn Fablet  <youenn@apple.com>
1153
1154         RTCDataChannel connectivity issues in Safari 11
1155         https://bugs.webkit.org/show_bug.cgi?id=173052
1156         <rdar://problem/32712143>
1157
1158         Reviewed by Alex Christensen.
1159
1160         Covered by updated test.
1161
1162         Before the patch, when sending an ArrayBufferView, RTCDataChannel was sending the whole ArrayBuffer backing the ArrayBufferView.
1163         With this patch, RTCDataChannel will now send only the bytes the ArrayBufferView is exposing.
1164
1165         * Modules/mediastream/RTCDataChannel.cpp:
1166         (WebCore::RTCDataChannel::send): Correctly handling sending of ArrayBufferView.
1167         (WebCore::RTCDataChannel::sendRawData): Helper routine for raw data sending.
1168         * Modules/mediastream/RTCDataChannel.h:
1169
1170 2017-09-14  Antti Koivisto  <antti@apple.com>
1171
1172         Computing animated style should not require renderers
1173         https://bugs.webkit.org/show_bug.cgi?id=171926
1174         <rdar://problem/34428035>
1175
1176         Reviewed by Sam Weinig.
1177
1178         CSS animation system is now element rather than renderer based. This allows cleaning up
1179         style resolution and render tree update code.
1180
1181         This also fixes bug animation doesn't run if display property is animated from one rendered type
1182         to another. Added a test case for this.
1183
1184         Test: transitions/transition-display-property-2.html
1185
1186         * page/animation/CSSAnimationController.cpp:
1187         (WebCore::CSSAnimationController::updateAnimations):
1188
1189             Pass in the old style instead of getting it from the renderer.
1190             Factor to return the animated style as a return value.
1191
1192         * page/animation/CSSAnimationController.h:
1193         * rendering/RenderElement.cpp:
1194         (WebCore::RenderElement::RenderElement):
1195         (WebCore::RenderElement::willBeDestroyed):
1196
1197             Animation are now canceled by RenderTreeUpdater::tearDownRenderers.
1198
1199         * rendering/RenderElement.h:
1200         (WebCore::RenderElement::hasInitialAnimatedStyle const): Deleted.
1201         (WebCore::RenderElement::setHasInitialAnimatedStyle): Deleted.
1202
1203             We no longer need to this concept.
1204
1205         * style/RenderTreeUpdater.cpp:
1206         (WebCore::RenderTreeUpdater::updateElementRenderer):
1207         (WebCore::RenderTreeUpdater::createRenderer):
1208
1209             We now get correct animated style from style resolution in all cases so we don't need to compute
1210             it separately for new renderers.
1211
1212         (WebCore::RenderTreeUpdater::tearDownRenderers):
1213
1214             Cancel animations when render tree is fully torn down. Keep them when updating style.
1215
1216         * style/RenderTreeUpdater.h:
1217         * style/StyleTreeResolver.cpp:
1218         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
1219
1220             We can now compute animated style without renderer. Special cases dealing with rendererless case
1221             can be removed.
1222
1223 2017-09-14  Joseph Pecoraro  <pecoraro@apple.com>
1224
1225         Web Inspector: Timeline should show when events preventDefault() was called on an event or not
1226         https://bugs.webkit.org/show_bug.cgi?id=176824
1227         <rdar://problem/34290931>
1228
1229         Reviewed by Devin Rousso.
1230
1231         Test: inspector/timeline/timeline-event-EventDispatch.html
1232
1233         * dom/EventTarget.cpp:
1234         (WebCore::EventTarget::fireEventListeners):
1235         * page/DOMWindow.cpp:
1236         (WebCore::DOMWindow::dispatchEvent):
1237         Include defaultPrevented when notifying inspector.
1238
1239         * inspector/InspectorInstrumentation.cpp:
1240         (WebCore::InspectorInstrumentation::didDispatchEventImpl):
1241         (WebCore::InspectorInstrumentation::didDispatchEventOnWindowImpl):
1242         * inspector/InspectorInstrumentation.h:
1243         (WebCore::InspectorInstrumentation::didDispatchEvent):
1244         (WebCore::InspectorInstrumentation::didDispatchEventOnWindow):
1245         Pass defaultPrevented on to agent.
1246
1247         * inspector/InspectorTimelineAgent.cpp:
1248         (WebCore::InspectorTimelineAgent::didDispatchEvent):
1249         (WebCore::InspectorTimelineAgent::didLayout):
1250         (WebCore::InspectorTimelineAgent::didPaint):
1251         * inspector/InspectorTimelineAgent.h:
1252         * inspector/TimelineRecordFactory.cpp:
1253         (WebCore::TimelineRecordFactory::appendLayoutRoot):
1254         (WebCore::TimelineRecordFactory::appendDidDispatchEventData):
1255         * inspector/TimelineRecordFactory.h:
1256         Append a boolean defaultPrevented property on the EventDispatch timeline record's data.
1257
1258 2017-09-14  Ryan Haddad  <ryanhaddad@apple.com>
1259
1260         Unreviewed, rolling out r222015.
1261
1262         The LayoutTests added with this change are flaky.
1263
1264         Reverted changeset:
1265
1266         "Web Inspector: Timeline should show when events
1267         preventDefault() was called on an event or not"
1268         https://bugs.webkit.org/show_bug.cgi?id=176824
1269         http://trac.webkit.org/changeset/222015
1270
1271 2017-09-14  Ms2ger  <Ms2ger@igalia.com>
1272
1273         Allow passing sequences to various WebGL2 methods.
1274         https://bugs.webkit.org/show_bug.cgi?id=176892
1275
1276         Reviewed by Sam Weinig.
1277
1278         This matches the specification as well as Gecko and Chromium.
1279
1280         Test: fast/canvas/webgl/webgl2/sequences.html
1281
1282         * html/canvas/WebGL2RenderingContext.cpp:
1283         (WebCore::WebGL2RenderingContext::uniform1uiv):
1284         (WebCore::WebGL2RenderingContext::uniform2uiv):
1285         (WebCore::WebGL2RenderingContext::uniform3uiv):
1286         (WebCore::WebGL2RenderingContext::uniform4uiv):
1287         (WebCore::WebGL2RenderingContext::uniformMatrix2x3fv):
1288         (WebCore::WebGL2RenderingContext::uniformMatrix3x2fv):
1289         (WebCore::WebGL2RenderingContext::uniformMatrix2x4fv):
1290         (WebCore::WebGL2RenderingContext::uniformMatrix4x2fv):
1291         (WebCore::WebGL2RenderingContext::uniformMatrix3x4fv):
1292         (WebCore::WebGL2RenderingContext::uniformMatrix4x3fv):
1293         (WebCore::WebGL2RenderingContext::vertexAttribI4iv):
1294         (WebCore::WebGL2RenderingContext::vertexAttribI4uiv):
1295         (WebCore::WebGL2RenderingContext::clearBufferiv):
1296         (WebCore::WebGL2RenderingContext::clearBufferuiv):
1297         (WebCore::WebGL2RenderingContext::clearBufferfv):
1298         * html/canvas/WebGL2RenderingContext.h:
1299         * html/canvas/WebGL2RenderingContext.idl:
1300
1301 2017-09-14  Sam Weinig  <sam@webkit.org>
1302
1303         [Cleanup] Cleanup uses of the FileList class
1304         https://bugs.webkit.org/show_bug.cgi?id=176800
1305
1306         Reviewed by Alex Christensen.
1307
1308         * fileapi/FileList.cpp:
1309         * fileapi/FileList.h:
1310
1311             Store list of files as Refs, rather than RefPtrs.
1312             Add direct accessor to the underlying Vector for faster iteration.
1313             Add file(unsigned) function to allow direct indexing, rather than using
1314             the DOM exposed item function which always does a length check.
1315
1316         * Modules/entriesapi/HTMLInputElementEntriesAPI.cpp:
1317         
1318             Remove unused RuntimeEnabledFeatures.h #include.
1319             Use modern for loop and the new direct file vector access. 
1320         
1321         * bindings/js/SerializedScriptValue.cpp:
1322         (WebCore::CloneSerializer::dumpIfTerminal):
1323         (WebCore::CloneSerializer::write):
1324         (WebCore::CloneDeserializer::readFile):
1325         (WebCore::CloneDeserializer::readTerminal):
1326         
1327             Remove unnecessary #includes, adopt auto, and use modern for-loop
1328             for FileList.
1329         
1330         * dom/DataTransfer.cpp:
1331         (WebCore::DataTransfer::files const):
1332         (WebCore::DataTransfer::hasFileOfType):
1333         
1334             Use auto.
1335         
1336         (WebCore::DataTransfer::createForInputEvent):
1337         
1338             Use initializer list for the typeToStringMap.
1339         
1340         * dom/DataTransferItemList.cpp:
1341         (WebCore::DataTransferItemList::ensureItems const):
1342         
1343             Use auto and modern for-loop for FileList.
1344         
1345         * html/FileInputType.cpp:
1346         (WebCore::FileInputType::filesFromFormControlState):
1347         (WebCore::FileInputType::saveFormControlState const):
1348         (WebCore::FileInputType::appendFormData const):
1349         (WebCore::FileInputType::handleDOMActivateEvent):
1350         (WebCore::FileInputType::getTypeSpecificValue):
1351         (WebCore::FileInputType::disabledAttributeChanged):
1352         (WebCore::FileInputType::multipleAttributeChanged):
1353         (WebCore::FileInputType::setFiles):
1354         (WebCore::FileInputType::receiveDroppedFiles):
1355         (WebCore::FileInputType::defaultToolTip const):
1356
1357             Adopt auto, brace-initialization, and modern for-loops.
1358
1359         * html/FileListCreator.cpp:
1360         (WebCore::appendDirectoryFiles):
1361         (WebCore::FileListCreator::createFileList):
1362         
1363             Update to work in terms of Vector<Ref<File>>.
1364
1365         * html/FormController.h:
1366         (WebCore::FormControlState::FormControlState):
1367         
1368             Re-format existing constructors and add one that takes an r-value
1369             Vector<String> to allow construction from a pre-created list (used 
1370             in FileInputType::saveFormControlState)
1371         
1372         * platform/DragData.h:
1373         * platform/gtk/DragDataGtk.cpp:
1374         (WebCore::DragData::asFilenames const):
1375         * platform/mac/DragDataMac.mm:
1376         (WebCore::DragData::asFilenames const):
1377         * platform/win/DragDataWin.cpp:
1378         (WebCore::DragData::asFilenames const):
1379         
1380             Convert asFilenames to return, rather than take, a Vector<String>.
1381
1382 2017-09-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1383
1384         [Harfbuzz] Wrong offset returned by HarfBuzzShaper::offsetForPosition() when target point is at the middle of a character
1385         https://bugs.webkit.org/show_bug.cgi?id=176897
1386
1387         Reviewed by Michael Catanzaro.
1388
1389         We should include the character when the point is greater than the center of the character.
1390
1391         Fixes: fast/multicol/hit-test-end-of-column-with-line-height.html
1392                fast/multicol/newmulticol/compare-with-old-impl/hit-test-end-of-column-with-line-height.html
1393
1394         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
1395         (WebCore::HarfBuzzShaper::HarfBuzzRun::characterIndexForXPosition):
1396
1397 2017-09-14  Yusuke Suzuki  <utatane.tea@gmail.com>
1398
1399         [JSC] Add PrivateSymbolMode::{Include,Exclude} for PropertyNameArray
1400         https://bugs.webkit.org/show_bug.cgi?id=176867
1401
1402         Reviewed by Sam Weinig.
1403
1404         * bindings/js/JSDOMConvertRecord.h:
1405         * bindings/js/SerializedScriptValue.cpp:
1406         (WebCore::CloneSerializer::serialize):
1407         * bridge/NP_jsobject.cpp:
1408         (_NPN_Enumerate):
1409
1410 2017-09-14  Joseph Pecoraro  <pecoraro@apple.com>
1411
1412         Web Inspector: Timeline should show when events preventDefault() was called on an event or not
1413         https://bugs.webkit.org/show_bug.cgi?id=176824
1414         <rdar://problem/34290931>
1415
1416         Reviewed by Devin Rousso.
1417
1418         Tests: inspector/timeline/timeline-event-CancelAnimationFrame.html
1419                inspector/timeline/timeline-event-EventDispatch.html
1420                inspector/timeline/timeline-event-FireAnimationFrame.html
1421                inspector/timeline/timeline-event-RequestAnimationFrame.html
1422                inspector/timeline/timeline-event-TimerFire.html
1423                inspector/timeline/timeline-event-TimerInstall.html
1424                inspector/timeline/timeline-event-TimerRemove.html
1425
1426         * dom/EventTarget.cpp:
1427         (WebCore::EventTarget::fireEventListeners):
1428         * page/DOMWindow.cpp:
1429         (WebCore::DOMWindow::dispatchEvent):
1430         Include defaultPrevented when notifying inspector.
1431
1432         * inspector/InspectorInstrumentation.cpp:
1433         (WebCore::InspectorInstrumentation::didDispatchEventImpl):
1434         (WebCore::InspectorInstrumentation::didDispatchEventOnWindowImpl):
1435         * inspector/InspectorInstrumentation.h:
1436         (WebCore::InspectorInstrumentation::didDispatchEvent):
1437         (WebCore::InspectorInstrumentation::didDispatchEventOnWindow):
1438         Pass defaultPrevented on to agent.
1439
1440         * inspector/InspectorTimelineAgent.cpp:
1441         (WebCore::InspectorTimelineAgent::didDispatchEvent):
1442         (WebCore::InspectorTimelineAgent::didLayout):
1443         (WebCore::InspectorTimelineAgent::didPaint):
1444         * inspector/InspectorTimelineAgent.h:
1445         * inspector/TimelineRecordFactory.cpp:
1446         (WebCore::TimelineRecordFactory::appendLayoutRoot):
1447         (WebCore::TimelineRecordFactory::appendDidDispatchEventData):
1448         * inspector/TimelineRecordFactory.h:
1449         Append a boolean defaultPrevented property on the EventDispatch timeline record's data.
1450
1451 2017-09-14  Maureen Daum  <mdaum@apple.com>
1452
1453         Introduce the option to mark an HTML element as having AutoFill available.
1454         https://bugs.webkit.org/show_bug.cgi?id=176710
1455
1456         Reviewed by Alex Christensen.
1457
1458         Introduce the option to mark an HTML element as having AutoFill available. Accessibility
1459         can use this property when deciding whether to announce that the focused field offers
1460         AutoFill.
1461
1462         * accessibility/AccessibilityObject.cpp:
1463         (WebCore::AccessibilityObject::isValueAutofillAvailable const):
1464         Check if the field is explicitly marked as having AutoFill available.
1465         * html/HTMLInputElement.cpp:
1466         (WebCore::HTMLInputElement::HTMLInputElement):
1467         * html/HTMLInputElement.h:
1468         (WebCore::HTMLInputElement::isAutoFillAvailable const):
1469         (WebCore::HTMLInputElement::setAutoFillAvailable):
1470
1471 2017-09-13  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1472
1473         [Curl] Move response related features into ResourceResponse
1474         https://bugs.webkit.org/show_bug.cgi?id=174654
1475
1476         Reviewed by Alex Christensen.
1477
1478         * platform/Curl.cmake:
1479         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
1480         (WebCore::ResourceHandleCurlDelegate::didReceiveAllHeaders):
1481         (WebCore::ResourceHandleCurlDelegate::didReceiveHeader):
1482         (WebCore::isHttpRedirect): Deleted.
1483         (WebCore::isHttpAuthentication): Deleted.
1484         (WebCore::isHttpNotModified): Deleted.
1485         (WebCore::isAppendableHeader): Deleted.
1486         (WebCore::ResourceHandleCurlDelegate::didReceiveHeaderLine): Deleted.
1487         * platform/network/curl/ResourceHandleCurlDelegate.h:
1488         * platform/network/curl/ResourceResponse.h:
1489         (WebCore::ResourceResponse::platformSuggestedFilename const): Deleted.
1490         * platform/network/curl/ResourceResponseCurl.cpp: Added.
1491         (WebCore::ResourceResponse::isAppendableHeader):
1492         (WebCore::ResourceResponse::appendHTTPHeaderField):
1493         (WebCore::ResourceResponse::setStatusLine):
1494         (WebCore::ResourceResponse::platformSuggestedFilename const):
1495         (WebCore::ResourceResponse::isRedirection const):
1496         (WebCore::ResourceResponse::isNotModified const):
1497         (WebCore::ResourceResponse::isUnauthorized const):
1498
1499 2017-09-13  Zalan Bujtas  <zalan@apple.com>
1500
1501         Switch multicolumn's spanner map from raw over to weak pointers.
1502         https://bugs.webkit.org/show_bug.cgi?id=176367
1503         <rdar://problem/34254896>
1504
1505         Reviewed by Antti Koivisto.
1506
1507         Test: fast/multicol/spanner-crash-when-adding-summary.html
1508
1509         * rendering/RenderMultiColumnFlowThread.cpp:
1510         (WebCore::RenderMultiColumnFlowThread::evacuateAndDestroy):
1511         (WebCore::RenderMultiColumnFlowThread::flowThreadDescendantInserted):
1512         (WebCore::RenderMultiColumnFlowThread::handleSpannerRemoval):
1513         * rendering/RenderMultiColumnFlowThread.h:
1514         * rendering/RenderMultiColumnSet.cpp:
1515         (WebCore::RenderMultiColumnSet::firstRendererInFlowThread const):
1516         (WebCore::RenderMultiColumnSet::lastRendererInFlowThread const):
1517         * rendering/RenderMultiColumnSpannerPlaceholder.cpp:
1518         (WebCore::RenderMultiColumnSpannerPlaceholder::RenderMultiColumnSpannerPlaceholder):
1519         * rendering/RenderMultiColumnSpannerPlaceholder.h:
1520
1521 2017-09-13  John Wilander  <wilander@apple.com>
1522
1523         Introduce Storage Access API (document parts) as an experimental feature
1524         https://bugs.webkit.org/show_bug.cgi?id=175759
1525         <rdar://problem/34414107>
1526
1527         Reviewed by Alex Christensen.
1528
1529         Storage Access API is an experimental feature which allows cross-origin,
1530         sandboxed iframes to request access to their first-party storage (as
1531         opposed to partitioned storage). This might be restricted to cookies or
1532         might cover all stateful mechanisms.
1533
1534         It introduces the following three developer-facing things:
1535         - A new readonly attribute, document.hasStorageAccess.
1536         - A new function, document.requestStorageAccess().
1537         - A new iframe sandbox token, allow-storage-access-by-user-activation.
1538
1539         Tests: http/tests/storageAccess/request-and-deny-storage-access-cross-origin-iframe.html
1540                http/tests/storageAccess/request-and-deny-storage-access-cross-origin-sandboxed-iframe.html
1541                http/tests/storageAccess/request-and-grant-storage-access-cross-origin-iframe.html
1542                http/tests/storageAccess/request-and-grant-storage-access-cross-origin-sandboxed-iframe.html
1543                http/tests/storageAccess/request-storage-access-cross-origin-sandboxed-iframe-with-unique-origin.html
1544                http/tests/storageAccess/request-storage-access-cross-origin-sandboxed-iframe-without-allow-token.html
1545                http/tests/storageAccess/request-storage-access-same-origin-iframe.html
1546                http/tests/storageAccess/request-storage-access-same-origin-sandboxed-iframe-without-allow-token.html
1547                http/tests/storageAccess/request-storage-access-same-origin-sandboxed-iframe.html
1548                http/tests/storageAccess/request-storage-access-top-frame.html
1549
1550         * dom/Document.cpp:
1551         (WebCore::Document::requestStorageAccess):
1552         * dom/Document.h:
1553         (WebCore::Document::hasStorageAccess const):
1554         (WebCore::Document::setUserGrantsStorageAccessOverride):
1555             See comments on WebCore::Internals below.
1556         * dom/Document.idl:
1557         * dom/SecurityContext.cpp:
1558         (WebCore::SecurityContext::isSupportedSandboxPolicy):
1559         (WebCore::SecurityContext::parseSandboxPolicy):
1560             Support for allow-storage-access-by-user-activation.
1561         * dom/SecurityContext.h:
1562         * loader/ResourceLoadObserver.cpp:
1563         (WebCore::ResourceLoadObserver::registerStorageAccess):
1564             Newly granted storage access is reported to 
1565             WebCore::ResourceLoadObserver.
1566         * loader/ResourceLoadObserver.h:
1567         * loader/ResourceLoadStatistics.cpp:
1568         (WebCore::encodeHashSet):
1569         (WebCore::ResourceLoadStatistics::encode const):
1570         (WebCore::decodeHashSet):
1571         (WebCore::ResourceLoadStatistics::decode):
1572         (WebCore::appendHashSet):
1573         (WebCore::ResourceLoadStatistics::toString const):
1574         (WebCore::mergeHashSet):
1575         (WebCore::ResourceLoadStatistics::merge):
1576             Storage of the new type of data.
1577         * loader/ResourceLoadStatistics.h:
1578         * page/Settings.in:
1579         * testing/Internals.cpp:
1580         (WebCore::Internals::resetToConsistentState):
1581         (WebCore::Internals::setUserGrantsStorageAccess):
1582         * testing/Internals.h:
1583         * testing/Internals.idl:
1584             Added setUserGrantsStorageAccess(). It is used to
1585             override the eventSender's keyboard input which
1586             always results in a cancel action on the confirm()
1587             dialog.
1588
1589 2017-09-13  Wenson Hsieh  <wenson_hsieh@apple.com>
1590
1591         Submitting a form can cause HTMLFormElement's associated elements vector to be mutated during iteration
1592         https://bugs.webkit.org/show_bug.cgi?id=176368
1593         <rdar://problem/34254998>
1594
1595         Reviewed by Ryosuke Niwa.
1596
1597         In the process of iterating over form.associatedElements() during form submission in FormSubmission::create, the
1598         page may cause us to clobber the vector of FormAssociatedElements* we're currently iterating over by inserting
1599         new form controls beneath the form element we're in the process of submitting. This happens because
1600         FormSubmission::create calls HTMLTextAreaElement::appendFormData, which requires layout to be up to date, which
1601         in turn makes us updateLayout() and set focus, which fires a `change` event, upon which the page's JavaScript
1602         inserts additonal DOM nodes into the form, modifying the vector of associated elements.
1603
1604         To mitigate this, instead of iterating over HTMLFormElement::associatedElements(), which returns a reference to
1605         the HTMLFormElement's actual m_associatedElements vector, we iterate over a new vector of
1606         Ref<FormAssociatedElement>s created from m_associatedElements.
1607
1608         This patch also removes an event dispatch assertion added in r212026. This assertion was added to catch any
1609         other events dispatched in this scope, since dispatching events there would have had security implications, but
1610         after making iteration over associated elements robust, this NoEventDispatchAssertion is no longer useful.
1611
1612         Test: fast/forms/append-children-during-form-submission.html
1613
1614         * loader/FormSubmission.cpp:
1615         (WebCore::FormSubmission::create):
1616
1617 2017-09-13  Devin Rousso  <webkit@devinrousso.com>
1618
1619         Web Inspector: Event Listeners section does not update when listeners are added/removed
1620         https://bugs.webkit.org/show_bug.cgi?id=170570
1621         <rdar://problem/31501645>
1622
1623         Reviewed by Joseph Pecoraro.
1624
1625         Test: inspector/dom/event-listener-add-remove.html
1626
1627         * dom/EventTarget.cpp:
1628         (WebCore::EventTarget::setAttributeEventListener):
1629         Fire willRemoveEventListener/didAddEventListener events when an attribute event listener is
1630         replaced by another event listener.
1631
1632         * inspector/InspectorDOMAgent.h:
1633         * inspector/InspectorDOMAgent.cpp:
1634         (WebCore::InspectorDOMAgent::didAddEventListener):
1635         (WebCore::InspectorDOMAgent::willRemoveEventListener):
1636         Dispatch an event to the inspector frontend whenever an event listener is added/removed.
1637
1638         * inspector/InspectorInstrumentation.cpp:
1639         (WebCore::InspectorInstrumentation::didAddEventListenerImpl):
1640         (WebCore::InspectorInstrumentation::willRemoveEventListenerImpl):
1641         Tie into existing instrumentation points for adding/removing event listeners.
1642
1643 2017-09-13  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1644
1645         [Curl] Bug fix for synchronous transfer
1646         https://bugs.webkit.org/show_bug.cgi?id=176552
1647
1648         Reviewed by Alex Christensen.
1649
1650         ResourceHandleInternal::m_delegate is null when transfer is synchronous. It should be set ResourceHandleCurlDelegate.
1651         Also the callback functions called when transfer is completed is wrong.
1652
1653         * platform/network/curl/ResourceHandleCurl.cpp:
1654         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
1655         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
1656         (WebCore::ResourceHandleCurlDelegate::dispatchSynchronousJob):
1657         (WebCore::ResourceHandleCurlDelegate::notifyFinish):
1658         (WebCore::ResourceHandleCurlDelegate::notifyFail):
1659         (WebCore::ResourceHandleCurlDelegate::didReceiveHeader):
1660         (WebCore::ResourceHandleCurlDelegate::didReceiveData):
1661         (WebCore::ResourceHandleCurlDelegate::willSendData):
1662
1663 2017-09-13  Matt Lewis  <jlewis3@apple.com>
1664
1665         Unreviewed, rolling out r221976.
1666
1667         The test introduced was flaky from point of addition.
1668
1669         Reverted changeset:
1670
1671         "Introduce Storage Access API (document parts) as an
1672         experimental feature"
1673         https://bugs.webkit.org/show_bug.cgi?id=175759
1674         http://trac.webkit.org/changeset/221976
1675
1676 2017-09-13  Said Abou-Hallawa  <sabouhallawa@apple.com>
1677
1678         Followup (r221805): Address comments and add more tests
1679         https://bugs.webkit.org/show_bug.cgi?id=176732
1680
1681         Reviewed by Darin Adler.
1682
1683         Test: http/tests/images/decode-slow-load-static-image.html
1684
1685         Code clean up and adding a new test to ensure multiple decode() promises
1686         can be resolved or rejected simultaneously without any issues.
1687
1688         * loader/ImageLoader.cpp:
1689         (WebCore::ImageLoader::decode):
1690         (WebCore::ImageLoader::decodeError):
1691         * loader/ImageLoader.h:
1692         * platform/graphics/BitmapImage.cpp:
1693         (WebCore::BitmapImage::decode):
1694         (WebCore::BitmapImage::callDecodingCallbacks):
1695         * platform/graphics/BitmapImage.h:
1696
1697 2017-09-13  Youenn Fablet  <youenn@apple.com>
1698
1699         Internals clearCacheStorageMemoryRepresentation should return a Promise
1700         https://bugs.webkit.org/show_bug.cgi?id=176818
1701
1702         Reviewed by Alex Christensen.
1703
1704         No observable change of behavior.
1705
1706         * Modules/cache/DOMCacheEngine.h:
1707         * testing/Internals.cpp:
1708         (WebCore::Internals::clearCacheStorageMemoryRepresentation): Returning a promise when clearing is completed.
1709         * testing/Internals.h:
1710         * testing/Internals.idl:
1711
1712 2017-09-13  Nikita Vasilyev  <nvasilyev@apple.com>
1713
1714         Web Inspector: Frontend should be made to expect and handle disabled properties
1715         https://bugs.webkit.org/show_bug.cgi?id=166787
1716         <rdar://problem/34379593>
1717
1718         Reviewed by Joseph Pecoraro.
1719
1720         Include disabled (commented out) CSS properties in the payload.
1721
1722         Tests: inspector/css/css-property.html
1723                inspector/css/matched-style-properties.html
1724
1725         * inspector/InspectorStyleSheet.cpp:
1726         (WebCore::InspectorStyle::populateAllProperties const):
1727         (WebCore::InspectorStyle::styleWithProperties const):
1728
1729 2017-09-13  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1730
1731         [GTK] Fails to build because 'Float32Array' has not been declared in AudioContext.h
1732         https://bugs.webkit.org/show_bug.cgi?id=176870
1733
1734         Reviewed by Konstantin Tokarev.
1735
1736         Add missing include of Float32Array.h
1737
1738         No new tests, its a build fix.
1739
1740         * Modules/webaudio/AudioContext.h:
1741
1742 2017-09-13  Andy Estes  <aestes@apple.com>
1743
1744         [CF] Upstream CFNetwork-related WebKitSystemInterface functions
1745         https://bugs.webkit.org/show_bug.cgi?id=176729
1746
1747         Reviewed by Alex Christensen.
1748
1749         * platform/ios/WebCoreSystemInterfaceIOS.mm:
1750         * platform/mac/PublicSuffixMac.mm:
1751         (WebCore::isPublicSuffix):
1752         * platform/mac/WebCoreSystemInterface.h:
1753         * platform/mac/WebCoreSystemInterface.mm:
1754         * platform/network/cf/ResourceRequestCFNet.cpp:
1755         (WebCore::ResourceRequest::doUpdatePlatformRequest):
1756         (WebCore::ResourceRequest::doUpdateResourceRequest):
1757         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
1758         (WebCore::setCONNECTProxyForStream):
1759         (WebCore::SocketStreamHandleImpl::createStreams):
1760         (WebCore::setCONNECTProxyAuthorizationForStream):
1761         (WebCore::SocketStreamHandleImpl::addCONNECTCredentials):
1762         (WebCore::copyCONNECTProxyResponse):
1763         (WebCore::SocketStreamHandleImpl::readStreamCallback):
1764         (WebCore::SocketStreamHandleImpl::writeStreamCallback):
1765         * platform/network/cocoa/ResourceRequestCocoa.mm:
1766         (WebCore::ResourceRequest::doUpdateResourceRequest):
1767         (WebCore::ResourceRequest::doUpdatePlatformRequest):
1768
1769 2017-09-13  Antti Koivisto  <antti@apple.com>
1770
1771         Make more of the CSS animation system internals element based
1772         https://bugs.webkit.org/show_bug.cgi?id=176832
1773
1774         Reviewed by Zalan Bujtas.
1775
1776         CSS animations animate element style. Continue moving away from renderers in the animation code.
1777
1778         Also do some general modernization.
1779
1780         * css/CSSComputedStyleDeclaration.cpp:
1781         (WebCore::computeRenderStyleForProperty):
1782         * page/animation/AnimationBase.cpp:
1783         (WebCore::AnimationBase::AnimationBase):
1784         * page/animation/AnimationBase.h:
1785         * page/animation/CSSAnimationController.cpp:
1786         (WebCore::CSSAnimationControllerPrivate::ensureCompositeAnimation):
1787         (WebCore::CSSAnimationControllerPrivate::clear):
1788         (WebCore::CSSAnimationControllerPrivate::updateAnimations):
1789         (WebCore::CSSAnimationControllerPrivate::updateAnimationTimerForElement):
1790         (WebCore::CSSAnimationControllerPrivate::isRunningAnimationOnRenderer const):
1791         (WebCore::CSSAnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer const):
1792         (WebCore::CSSAnimationControllerPrivate::pauseAnimationAtTime):
1793         (WebCore::CSSAnimationControllerPrivate::pauseTransitionAtTime):
1794         (WebCore::CSSAnimationControllerPrivate::animatedStyleForElement):
1795         (WebCore::CSSAnimationControllerPrivate::computeExtentOfAnimation const):
1796         (WebCore::CSSAnimationController::cancelAnimations):
1797         (WebCore::CSSAnimationController::updateAnimations):
1798         (WebCore::CSSAnimationController::animatedStyleForRenderer):
1799         (WebCore::CSSAnimationController::computeExtentOfAnimation const):
1800         (WebCore::CSSAnimationController::pauseAnimationAtTime):
1801         (WebCore::CSSAnimationController::pauseTransitionAtTime):
1802         (WebCore::CSSAnimationControllerPrivate::updateAnimationTimerForRenderer): Deleted.
1803         (WebCore::CSSAnimationControllerPrivate::getAnimatedStyleForRenderer): Deleted.
1804         (WebCore::CSSAnimationController::getAnimatedStyleForRenderer): Deleted.
1805         * page/animation/CSSAnimationController.h:
1806         * page/animation/CSSAnimationControllerPrivate.h:
1807         * page/animation/CompositeAnimation.cpp:
1808         (WebCore::CompositeAnimation::~CompositeAnimation):
1809         (WebCore::CompositeAnimation::clearElement):
1810         (WebCore::CompositeAnimation::updateTransitions):
1811         (WebCore::CompositeAnimation::updateKeyframeAnimations):
1812         (WebCore::CompositeAnimation::animate):
1813         (WebCore::CompositeAnimation::clearRenderer): Deleted.
1814         * page/animation/CompositeAnimation.h:
1815         * page/animation/ImplicitAnimation.cpp:
1816         (WebCore::ImplicitAnimation::ImplicitAnimation):
1817         (WebCore::ImplicitAnimation::animate):
1818         * page/animation/ImplicitAnimation.h:
1819         (WebCore::ImplicitAnimation::create):
1820         * page/animation/KeyframeAnimation.cpp:
1821         (WebCore::KeyframeAnimation::KeyframeAnimation):
1822         (WebCore::KeyframeAnimation::animate):
1823         * page/animation/KeyframeAnimation.h:
1824         * rendering/RenderElement.cpp:
1825         (WebCore::RenderElement::willBeDestroyed):
1826         * rendering/RenderLayer.cpp:
1827         (WebCore::RenderLayer::currentTransform const):
1828         * style/RenderTreeUpdater.cpp:
1829         (WebCore::RenderTreeUpdater::createRenderer):
1830         * style/StyleTreeResolver.cpp:
1831         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
1832         * testing/Internals.cpp:
1833         (WebCore::Internals::pauseAnimationAtTimeOnElement):
1834         (WebCore::Internals::pauseAnimationAtTimeOnPseudoElement):
1835         (WebCore::Internals::pauseTransitionAtTimeOnElement):
1836         (WebCore::Internals::pauseTransitionAtTimeOnPseudoElement):
1837
1838 2017-09-13  Daniel Bates  <dabates@apple.com>
1839
1840         Make history.pushState()/replaceState() more closely aligned to the HTML standard
1841         https://bugs.webkit.org/show_bug.cgi?id=176730
1842         <rdar://problem/33839265>
1843
1844         Reviewed by Alex Christensen.
1845
1846         Update history.pushState()/replaceState() to more closely align with the algorithm
1847         specified in <https://html.spec.whatwg.org/multipage/history.html#dom-history-pushstate-2> (9 September 2017).
1848
1849         Test: http/tests/security/history-pushState-replaceState-from-sandboxed-iframe.html
1850
1851         * page/History.cpp:
1852         (WebCore::History::stateObjectAdded):
1853         * page/SecurityOrigin.cpp:
1854         (WebCore::SecurityOrigin::extractInnerURL): Use URL constructor that takes a base URL as opposed
1855         to using the special ParsedURLString-variant because the latter can only be used to parse a string
1856         returned from URL::string(). And the extracted inner URL does not meet this criterion. Using the
1857         ParsedURLString-variant of the URL constructor with a string that is not the result of URL::string()
1858         will cause an assertion failure in a debug build.
1859
1860 2017-09-13  John Wilander  <wilander@apple.com>
1861
1862         Introduce Storage Access API (document parts) as an experimental feature
1863         https://bugs.webkit.org/show_bug.cgi?id=175759
1864         <rdar://problem/33666847>
1865
1866         Reviewed by Alex Christensen.
1867
1868         Storage Access API is an experimental feature which allows cross-origin,
1869         sandboxed iframes to request access to their first-party storage (as
1870         opposed to partitioned storage). This might be restricted to cookies or
1871         might cover all stateful mechanisms.
1872
1873         It introduces the following three developer-facing things:
1874         - A new readonly attribute, document.hasStorageAccess.
1875         - A new function, document.requestStorageAccess().
1876         - A new iframe sandbox token, allow-storage-access-by-user-activation.
1877
1878         Tests: http/tests/loading/resourceLoadStatistics/request-and-deny-storage-access-cross-origin-iframe.html
1879                http/tests/loading/resourceLoadStatistics/request-and-deny-storage-access-cross-origin-sandboxed-iframe.html
1880                http/tests/loading/resourceLoadStatistics/request-and-grant-storage-access-cross-origin-iframe.html
1881                http/tests/loading/resourceLoadStatistics/request-and-grant-storage-access-cross-origin-sandboxed-iframe.html
1882                http/tests/loading/resourceLoadStatistics/request-storage-access-cross-origin-sandboxed-iframe-with-unique-origin.html
1883                http/tests/loading/resourceLoadStatistics/request-storage-access-cross-origin-sandboxed-iframe-without-allow-token.html
1884                http/tests/loading/resourceLoadStatistics/request-storage-access-same-origin-iframe.html
1885                http/tests/loading/resourceLoadStatistics/request-storage-access-same-origin-sandboxed-iframe-without-allow-token.html
1886                http/tests/loading/resourceLoadStatistics/request-storage-access-same-origin-sandboxed-iframe.html
1887                http/tests/loading/resourceLoadStatistics/request-storage-access-top-frame.html
1888
1889         * dom/Document.cpp:
1890         (WebCore::Document::requestStorageAccess):
1891         * dom/Document.h:
1892         (WebCore::Document::hasStorageAccess const):
1893         (WebCore::Document::setUserGrantsStorageAccessOverride):
1894             See comments on WebCore::Internals below.
1895         * dom/Document.idl:
1896         * dom/SecurityContext.cpp:
1897         (WebCore::SecurityContext::isSupportedSandboxPolicy):
1898         (WebCore::SecurityContext::parseSandboxPolicy):
1899             Support for allow-storage-access-by-user-activation.
1900         * dom/SecurityContext.h:
1901         * loader/ResourceLoadObserver.cpp:
1902         (WebCore::ResourceLoadObserver::registerStorageAccess):
1903             Newly granted storage access is reported to 
1904             WebCore::ResourceLoadObserver.
1905         * loader/ResourceLoadObserver.h:
1906         * loader/ResourceLoadStatistics.cpp:
1907         (WebCore::encodeHashSet):
1908         (WebCore::ResourceLoadStatistics::encode const):
1909         (WebCore::decodeHashSet):
1910         (WebCore::ResourceLoadStatistics::decode):
1911         (WebCore::appendHashSet):
1912         (WebCore::ResourceLoadStatistics::toString const):
1913         (WebCore::mergeHashSet):
1914         (WebCore::ResourceLoadStatistics::merge):
1915             Storage of the new type of data.
1916         * loader/ResourceLoadStatistics.h:
1917         * page/Settings.in:
1918         * testing/Internals.cpp:
1919         (WebCore::Internals::resetToConsistentState):
1920         (WebCore::Internals::setUserGrantsStorageAccess):
1921         * testing/Internals.h:
1922         * testing/Internals.idl:
1923             Added setUserGrantsStorageAccess(). It is used to
1924             override the eventSender's keyboard input which
1925             always results in a cancel action on the confirm()
1926             dialog.
1927
1928 2017-09-13  Carlos Garcia Campos  <cgarcia@igalia.com>
1929
1930         [HarfBuzz] Wrong offset returned by HarfBuzzShaper::offsetForPosition in some cases
1931         https://bugs.webkit.org/show_bug.cgi?id=176848
1932
1933         Reviewed by Michael Catanzaro.
1934
1935         This patch rewrites HarfBuzzShaper::HarfBuzzRun::characterIndexForXPosition() to make it simpler and ensure we
1936         return the right offset in all the cases, also honoring now the includePartialGlyphs parameter that we were
1937         ignoring in FontCascade::offsetForPositionForComplexText().
1938
1939         Fixes several tests that started to fail after r221909.
1940
1941         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
1942         (WebCore::FontCascade::offsetForPositionForComplexText const):
1943         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
1944         (WebCore::HarfBuzzShaper::HarfBuzzRun::characterIndexForXPosition):
1945         (WebCore::HarfBuzzShaper::offsetForPosition):
1946         * platform/graphics/harfbuzz/HarfBuzzShaper.h:
1947
1948 2017-09-13  Per Arne Vollan  <pvollan@apple.com>
1949
1950         Initialize InternalSettings member variable.
1951         https://bugs.webkit.org/show_bug.cgi?id=176838
1952
1953         Reviewed by Brent Fulgham.
1954
1955         Initialize the m_webVREnabled member in the constructor.
1956
1957         * testing/InternalSettings.cpp:
1958         (WebCore::InternalSettings::Backup::Backup):
1959
1960 2017-09-13  Ms2ger  <Ms2ger@igalia.com>
1961
1962         Make WebGLRenderingContextBase::TypedList::data() const-correct.
1963         https://bugs.webkit.org/show_bug.cgi?id=176833
1964
1965         Reviewed by Sam Weinig.
1966
1967         No change of behavior.
1968
1969         * html/canvas/WebGLRenderingContextBase.cpp:
1970         (WebCore::WebGLRenderingContextBase::validateUniformMatrixParameters):
1971         * html/canvas/WebGLRenderingContextBase.h:
1972         (WebCore::WebGLRenderingContextBase::TypedList::data const):
1973         * platform/graphics/GraphicsContext3D.h:
1974         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1975         (WebCore::GraphicsContext3D::uniform1fv):
1976         (WebCore::GraphicsContext3D::uniform2fv):
1977         (WebCore::GraphicsContext3D::uniform3fv):
1978         (WebCore::GraphicsContext3D::uniform4fv):
1979         (WebCore::GraphicsContext3D::uniform1iv):
1980         (WebCore::GraphicsContext3D::uniform2iv):
1981         (WebCore::GraphicsContext3D::uniform3iv):
1982         (WebCore::GraphicsContext3D::uniform4iv):
1983         (WebCore::GraphicsContext3D::uniformMatrix2fv):
1984         (WebCore::GraphicsContext3D::uniformMatrix3fv):
1985         (WebCore::GraphicsContext3D::uniformMatrix4fv):
1986         (WebCore::GraphicsContext3D::vertexAttrib1fv):
1987         (WebCore::GraphicsContext3D::vertexAttrib2fv):
1988         (WebCore::GraphicsContext3D::vertexAttrib3fv):
1989         (WebCore::GraphicsContext3D::vertexAttrib4fv):
1990
1991 2017-09-13  Sam Weinig  <sam@webkit.org>
1992
1993         Remove CanvasRenderingContext2D.commit(), it is a no-op and not part the standard
1994         https://bugs.webkit.org/show_bug.cgi?id=176821
1995
1996         Reviewed by Darin Adler.
1997
1998         * html/canvas/CanvasRenderingContext2D.h:
1999         * html/canvas/CanvasRenderingContext2D.idl:
2000         
2001             Remove the commit operation. It is no longer part the standard (it was
2002             moved to OffscreenCanvasRenderingContext2D) and it was a no-op.
2003
2004 2017-09-12  Matt Rajca  <mrajca@apple.com>
2005
2006         Ensure the user interacted with the page before setting m_userHasInteractedWithMediaElement
2007         https://bugs.webkit.org/show_bug.cgi?id=176816
2008
2009         Reviewed by Eric Carlson.
2010
2011         Currently, when the user presses a keyboard shortcut in the client to reload a page, that may
2012         get registered as a user gesture on the reloaded page. Before setting the
2013         m_userHasInteractedWithMediaElement flag, we should check if a user gesture was actually handled
2014         by checking the userDidInteractWithPage flag. In case of key events that aren't handled by the
2015         page, this will be set to false by EventHandler:
2016
2017             // If the key event was not handled, do not treat it as user interaction with the page.
2018             if (topDocument && !wasHandled)
2019                 topDocument->setUserDidInteractWithPage(savedUserDidInteractWithPage);
2020
2021         We need to revisit this in the future in webkit.org/b/176817 and ensure user gesture tokens
2022         don't carry over across reloads of the page.
2023
2024         Tests: I wasn't able to trigger the pathological scenario this aims to fix with a test that calls
2025         window.location.reload() from a synthetic keyDown event.
2026
2027         * dom/Document.cpp:
2028         (WebCore::Document::noteUserInteractionWithMediaElement):
2029
2030 2017-09-13  Ms2ger  <Ms2ger@igalia.com>
2031
2032         Disallow passing null values to various WebGL2 methods.
2033         https://bugs.webkit.org/show_bug.cgi?id=176829
2034
2035         Reviewed by Yusuke Suzuki.
2036
2037         This matches the specification as well as Gecko and Chromium.
2038
2039         Test: fast/canvas/webgl/webgl2/bindings.html
2040
2041         * html/canvas/WebGL2RenderingContext.cpp:
2042         (WebCore::WebGL2RenderingContext::beginQuery):
2043         (WebCore::WebGL2RenderingContext::getQueryParameter):
2044         (WebCore::WebGL2RenderingContext::samplerParameteri):
2045         (WebCore::WebGL2RenderingContext::samplerParameterf):
2046         (WebCore::WebGL2RenderingContext::getSamplerParameter):
2047         (WebCore::WebGL2RenderingContext::clientWaitSync):
2048         (WebCore::WebGL2RenderingContext::waitSync):
2049         (WebCore::WebGL2RenderingContext::getSyncParameter):
2050         (WebCore::WebGL2RenderingContext::transformFeedbackVaryings):
2051         (WebCore::WebGL2RenderingContext::getTransformFeedbackVarying):
2052         (WebCore::WebGL2RenderingContext::getUniformIndices):
2053         (WebCore::WebGL2RenderingContext::getUniformBlockIndex):
2054         (WebCore::WebGL2RenderingContext::getActiveUniformBlockParameter):
2055         (WebCore::WebGL2RenderingContext::getActiveUniformBlockName):
2056         (WebCore::WebGL2RenderingContext::uniformBlockBinding):
2057         * html/canvas/WebGL2RenderingContext.h:
2058         * html/canvas/WebGL2RenderingContext.idl:
2059
2060 2017-09-13  Sergio Villar Senin  <svillar@igalia.com>
2061
2062         [WebVR] Add IDLs and stubs
2063         https://bugs.webkit.org/show_bug.cgi?id=174202
2064
2065         Reviewed by Dean Jackson.
2066
2067         Adding the complete set of IDLs for the WebVR 1.1 spec including the interface stubs which
2068         currently do nothing.
2069
2070         Tests: webvr/webvr-disabled.html
2071                webvr/webvr-enabled.html
2072
2073         * CMakeLists.txt:
2074         * DerivedSources.make:
2075         * Modules/webvr/DOMWindowWebVR.idl: Added.
2076         * Modules/webvr/GamepadWebVR.cpp: Added.
2077         (WebCore::GamepadWebVR::GamepadWebVR):
2078         (WebCore::GamepadWebVR::~GamepadWebVR):
2079         (WebCore::GamepadWebVR::displayId):
2080         * Modules/webvr/GamepadWebVR.h: Added.
2081         * Modules/webvr/GamepadWebVR.idl: Added.
2082         * Modules/webvr/NavigatorWebVR.cpp: Added.
2083         (WebCore::NavigatorWebVR::getVRDisplays):
2084         (WebCore::NavigatorWebVR::activeVRDisplays):
2085         (WebCore::NavigatorWebVR::vrEnabled):
2086         * Modules/webvr/NavigatorWebVR.h: Added.
2087         * Modules/webvr/NavigatorWebVR.idl: Added.
2088         * Modules/webvr/VRDisplay.cpp: Added.
2089         (WebCore::VRDisplay::create):
2090         (WebCore::VRDisplay::VRDisplay):
2091         (WebCore::VRDisplay::isConnected const):
2092         (WebCore::VRDisplay::isPresenting const):
2093         (WebCore::VRDisplay::capabilities const):
2094         (WebCore::VRDisplay::stageParameters const):
2095         (WebCore::VRDisplay::getEyeParameters const):
2096         (WebCore::VRDisplay::displayId const):
2097         (WebCore::VRDisplay::displayName const):
2098         (WebCore::VRDisplay::getFrameData const):
2099         (WebCore::VRDisplay::getPose const):
2100         (WebCore::VRDisplay::resetPose):
2101         (WebCore::VRDisplay::depthNear const):
2102         (WebCore::VRDisplay::setDepthNear):
2103         (WebCore::VRDisplay::depthFar const):
2104         (WebCore::VRDisplay::setDepthFar):
2105         (WebCore::VRDisplay::requestAnimationFrame):
2106         (WebCore::VRDisplay::cancelAnimationFrame):
2107         (WebCore::VRDisplay::requestPresent):
2108         (WebCore::VRDisplay::exitPresent):
2109         (WebCore::VRDisplay::getLayers const):
2110         (WebCore::VRDisplay::submitFrame):
2111         (WebCore::VRDisplay::hasPendingActivity const):
2112         (WebCore::VRDisplay::activeDOMObjectName const):
2113         (WebCore::VRDisplay::canSuspendForDocumentSuspension const):
2114         (WebCore::VRDisplay::stop):
2115         * Modules/webvr/VRDisplay.h: Added.
2116         * Modules/webvr/VRDisplay.idl: Added.
2117         * Modules/webvr/VRDisplayCapabilities.cpp: Added.
2118         (WebCore::VRDisplayCapabilities::hasPosition const):
2119         (WebCore::VRDisplayCapabilities::hasOrientation const):
2120         (WebCore::VRDisplayCapabilities::hasExternalDisplay const):
2121         (WebCore::VRDisplayCapabilities::canPresent const):
2122         (WebCore::VRDisplayCapabilities::maxLayer const):
2123         * Modules/webvr/VRDisplayCapabilities.h: Added.
2124         (WebCore::VRDisplayCapabilities::create):
2125         * Modules/webvr/VRDisplayCapabilities.idl: Added.
2126         * Modules/webvr/VRDisplayEvent.cpp: Added.
2127         (WebCore::VRDisplayEvent::VRDisplayEvent):
2128         (WebCore::VRDisplayEvent::display const):
2129         (WebCore::VRDisplayEvent::reason const):
2130         (WebCore::VRDisplayEvent::eventInterface const):
2131         * Modules/webvr/VRDisplayEvent.h: Added.
2132         * Modules/webvr/VRDisplayEvent.idl: Added.
2133         * Modules/webvr/VRDisplayEventReason.h: Added.
2134         * Modules/webvr/VRDisplayEventReason.idl: Added.
2135         * Modules/webvr/VREye.h: Added.
2136         * Modules/webvr/VREye.idl: Added.
2137         * Modules/webvr/VREyeParameters.cpp: Added.
2138         (WebCore::VREyeParameters::VREyeParameters):
2139         (WebCore::VREyeParameters::offset const):
2140         (WebCore::VREyeParameters::fieldOfView const):
2141         (WebCore::VREyeParameters::renderWidth const):
2142         (WebCore::VREyeParameters::renderHeight const):
2143         * Modules/webvr/VREyeParameters.h: Added.
2144         (WebCore::VREyeParameters::create):
2145         * Modules/webvr/VREyeParameters.idl: Added.
2146         * Modules/webvr/VRFieldOfView.cpp: Added.
2147         (WebCore::VRFieldOfView::upDegrees const):
2148         (WebCore::VRFieldOfView::rightDegrees const):
2149         (WebCore::VRFieldOfView::downDegrees const):
2150         (WebCore::VRFieldOfView::leftDegrees const):
2151         * Modules/webvr/VRFieldOfView.h: Added.
2152         (WebCore::VRFieldOfView::create):
2153         * Modules/webvr/VRFieldOfView.idl: Added.
2154         * Modules/webvr/VRFrameData.cpp: Added.
2155         (WebCore::VRFrameData::VRFrameData):
2156         (WebCore::VRFrameData::timestamp const):
2157         (WebCore::VRFrameData::leftProjectionMatrix const):
2158         (WebCore::VRFrameData::leftViewMatrix const):
2159         (WebCore::VRFrameData::rightProjectionMatrix const):
2160         (WebCore::VRFrameData::rightViewMatrix const):
2161         (WebCore::VRFrameData::pose const):
2162         * Modules/webvr/VRFrameData.h: Added.
2163         (WebCore::VRFrameData::create):
2164         * Modules/webvr/VRFrameData.idl: Added.
2165         * Modules/webvr/VRLayerInit.h: Added.
2166         * Modules/webvr/VRLayerInit.idl: Added.
2167         * Modules/webvr/VRPose.cpp: Added.
2168         (WebCore::VRPose::position const):
2169         (WebCore::VRPose::linearVelocity const):
2170         (WebCore::VRPose::linearAcceleration const):
2171         (WebCore::VRPose::orientation const):
2172         (WebCore::VRPose::angularVelocity const):
2173         (WebCore::VRPose::angularAcceleration const):
2174         * Modules/webvr/VRPose.h: Added.
2175         (WebCore::VRPose::create):
2176         * Modules/webvr/VRPose.idl: Added.
2177         * Modules/webvr/VRStageParameters.cpp: Added.
2178         (WebCore::VRStageParameters::sittingToStandingTransform const):
2179         (WebCore::VRStageParameters::sizeX const):
2180         (WebCore::VRStageParameters::sizeZ const):
2181         * Modules/webvr/VRStageParameters.h: Added.
2182         (WebCore::VRStageParameters::create):
2183         * Modules/webvr/VRStageParameters.idl: Added.
2184         * WebCore.xcodeproj/project.pbxproj:
2185         * bindings/js/WebCoreBuiltinNames.h:
2186         * dom/EventNames.h:
2187         * dom/EventNames.in:
2188         * dom/EventTargetFactory.in:
2189         * features.json:
2190         * page/RuntimeEnabledFeatures.h:
2191         (WebCore::RuntimeEnabledFeatures::setWebVREnabled):
2192         (WebCore::RuntimeEnabledFeatures::webVREnabled const):
2193         * testing/InternalSettings.cpp:
2194         (WebCore::InternalSettings::Backup::restoreTo):
2195         (WebCore::InternalSettings::setWebVREnabled):
2196         * testing/InternalSettings.h:
2197         * testing/InternalSettings.idl:
2198
2199 2017-09-13  Ms2ger  <Ms2ger@igalia.com>
2200
2201         Update the type of the texture argument to framebufferTextureLayer().
2202         https://bugs.webkit.org/show_bug.cgi?id=176785
2203
2204         Reviewed by Yusuke Suzuki.
2205
2206         This matches the specification as well as Gecko and Chromium.
2207
2208         Also move getInternalformatParameter() to the position it has in the
2209         specification, for easier comparison.
2210
2211         Test: fast/canvas/webgl/webgl2/bindings.html
2212
2213         * html/canvas/WebGL2RenderingContext.cpp:
2214         (WebCore::WebGL2RenderingContext::framebufferTextureLayer):
2215         * html/canvas/WebGL2RenderingContext.h:
2216         * html/canvas/WebGL2RenderingContext.idl:
2217
2218 2017-09-13  Zan Dobersek  <zdobersek@igalia.com>
2219
2220         [EME] Implement CDMInstanceClearKey::updateLicense()
2221         https://bugs.webkit.org/show_bug.cgi?id=176791
2222
2223         Reviewed by Xabier Rodriguez-Calvar.
2224
2225         Implement the updateLicense() method for CDMInstanceClearKey.
2226         The response data is parsed as JSON, matching that agains either
2227         'license' or 'license release acknowledgement' formats (depending
2228         on either 'keys' or 'kids' object keys being present). If any
2229         format is recognized, appropriate steps are taken.
2230
2231         In case of the 'license' format, the passed-in keys are matched
2232         against existing ones. If some keys have changed or have been
2233         newly introduced, the key information is sorted by key ID size
2234         and data to enforce order. After that the KeyStatusVector object
2235         is constructed, containing key ID and status information for all
2236         the keys associated with this session. Finally callback is
2237         dispatched, signalling a successful operation and passing the
2238         KeyStatusVector, if any, back to the caller.
2239
2240         In case of the 'license release acknowledgement' format, the
2241         session data for this session ID is removed from the ClearKey state
2242         singleton. The callback is dispatched signalling the session closure
2243         and successfull completion of the operation.
2244
2245         Finally, if no format is deduced, the callback is again dispatched,
2246         but now signalling an operation failure.
2247
2248         No new tests -- expectations for the relevant tests are updated
2249         to reflect the introduced changes.
2250
2251         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
2252         (WebCore::ClearKeyState::keys):
2253         (WebCore::ClearKeyState::singleton):
2254         (WebCore::parseLicenseFormat):
2255         (WebCore::parseLicenseReleaseAcknowledgementFormat):
2256         (WebCore::CDMInstanceClearKey::updateLicense):
2257
2258 2017-09-13  Ryosuke Niwa  <rniwa@webkit.org>
2259
2260         Refactor WebContentReader out of EditorMac and EditorIOS
2261         https://bugs.webkit.org/show_bug.cgi?id=176770
2262
2263         Reviewed by Sam Weinig.
2264
2265         Extracted WebContentReader.h, WebContentReaderMac.mm, and WebContentIOS.mm from Pasteboard.h,
2266         EditorMac.mm, and EditorIOS.mm respectively.
2267
2268         Also moved createFragmentAndAddResources from EditorCocoa.mm to WebContentReaderCocoa.mm
2269         and createFragmentForImageAndURL and createFragmentForImageResourceAndAddResource to markup.cpp.
2270
2271         * Configurations/WebCore.xcconfig:
2272         * PlatformMac.cmake:
2273         * WebCore.xcodeproj/project.pbxproj:
2274         * editing/Editor.cpp:
2275         (WebCore::Editor::createFragmentForImageAndURL): Deleted.
2276         * editing/Editor.h:
2277         * editing/WebContentReader.h: Added.
2278         * editing/cocoa/EditorCocoa.mm:
2279         (WebCore::Editor::replaceSelectionWithAttributedString):
2280         (WebCore::Editor::createFragment): Deleted.
2281         (WebCore::Editor::createFragmentForImageResourceAndAddResource): Deleted.
2282         (WebCore::Editor::createFragmentAndAddResources): Deleted.
2283         * editing/cocoa/WebContentReaderCocoa.mm: Added.
2284         (WebCore::createFragmentForImageResourceAndAddResource):
2285         (WebCore::createFragment):
2286         (WebCore::createFragmentAndAddResources):
2287         * editing/ios/EditorIOS.mm:
2288         (WebCore::Editor::WebContentReader): Moved to WebContentReaderIOS.mm.
2289         * editing/ios/WebContentReaderIOS.mm: Added.
2290         (WebCore::WebContentReader::addFragment):
2291         (WebCore::WebContentReader::readWebArchive):
2292         (WebCore::WebContentReader::readFilenames):
2293         (WebCore::WebContentReader::readHTML):
2294         (WebCore::WebContentReader::readRTFD):
2295         (WebCore::WebContentReader::readRTF):
2296         (WebCore::WebContentReader::readImage):
2297         (WebCore::WebContentReader::readURL):
2298         (WebCore::WebContentReader::readPlainText):
2299         * editing/mac/EditorMac.mm:
2300         (WebCore::Editor::WebContentReader): Moved to WebContentReaderMac.mm.
2301         * editing/mac/WebContentReaderMac.mm: Added.
2302         (WebCore::WebContentReader::readWebArchive):
2303         (WebCore::WebContentReader::readFilenames):
2304         (WebCore::WebContentReader::readHTML):
2305         (WebCore::WebContentReader::readRTFD):
2306         (WebCore::WebContentReader::readRTF):
2307         (WebCore::WebContentReader::readImage):
2308         (WebCore::WebContentReader::readURL):
2309         (WebCore::WebContentReader::readPlainText):
2310         * editing/markup.cpp:
2311         (WebCore::createFragmentForImageAndURL):
2312         (WebCore::createFragmentForImageResourceAndAddResource):
2313         * editing/markup.h:
2314
2315 2017-09-12  Yusuke Suzuki  <utatane.tea@gmail.com>
2316
2317         [DFG] Optimize WeakMap::get by adding intrinsic and fixup
2318         https://bugs.webkit.org/show_bug.cgi?id=176010
2319
2320         Reviewed by Filip Pizlo.
2321
2322         * platform/network/curl/CurlJobManager.cpp:
2323         (WebCore::CurlJobList::finishJobs):
2324
2325 2017-09-12  Frederic Wang  <fwang@igalia.com>
2326
2327         Rename isRootLayer to isRenderViewLayer
2328         https://bugs.webkit.org/show_bug.cgi?id=176684
2329
2330         Reviewed by Darin Adler.
2331
2332         This patch was generated with the help of do-webcore-rename with some coding style adjustment.
2333
2334         No new tests, behavior unchanged.
2335
2336         * rendering/RenderLayer.cpp:
2337         (WebCore::RenderLayer::RenderLayer):
2338         (WebCore::RenderLayer::enclosingTransformedAncestor const):
2339         (WebCore::RenderLayer::enclosingFilterRepaintLayer const):
2340         (WebCore::RenderLayer::setFilterBackendNeedsRepaintingInRect):
2341         (WebCore::RenderLayer::clippingRootForPainting const):
2342         (WebCore::RenderLayer::beginTransparencyLayers):
2343         (WebCore::shouldSuppressPaintingLayer):
2344         (WebCore::RenderLayer::paintFixedLayersInNamedFlows):
2345         (WebCore::RenderLayer::hitTest):
2346         (WebCore::RenderLayer::hitTestFixedLayersInNamedFlows):
2347         (WebCore::RenderLayer::calculateClipRects const):
2348         * rendering/RenderLayer.h:
2349         * rendering/RenderLayerBacking.cpp:
2350         (WebCore::RenderLayerBacking::RenderLayerBacking):
2351         (WebCore::RenderLayerBacking::updateConfiguration):
2352         (WebCore::RenderLayerBacking::updateAfterDescendants):
2353         (WebCore::RenderLayerBacking::paintsIntoWindow const):
2354         (WebCore::RenderLayerBacking::paintIntoLayer):
2355         * rendering/RenderLayerCompositor.cpp:
2356         (WebCore::RenderLayerCompositor::logLayerInfo):
2357         (WebCore::RenderLayerCompositor::needsCompositingUpdateForStyleChangeOnNonCompositedLayer const):
2358         (WebCore::RenderLayerCompositor::updateBacking):
2359         (WebCore::RenderLayerCompositor::repaintInCompositedAncestor):
2360         (WebCore::RenderLayerCompositor::addToOverlapMap):
2361         (WebCore::RenderLayerCompositor::computeCompositingRequirementsForNamedFlowFixed):
2362         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2363         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTreeForNamedFlowFixed):
2364         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
2365         (WebCore::RenderLayerCompositor::needsToBeComposited const):
2366         (WebCore::RenderLayerCompositor::requiresOwnBackingStore const): Also move the IOS condition
2367         up to avoid that check-webkit-style complains.
2368         (WebCore::RenderLayerCompositor::reasonsForCompositing const):
2369         (WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer const):
2370         (WebCore::RenderLayerCompositor::needsFixedRootBackgroundLayer const):
2371         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
2372
2373 2017-09-12  Wenson Hsieh  <wenson_hsieh@apple.com>
2374
2375         [iOS DnD] Support DataTransfer.getData and DataTransfer.setData when dragging or dropping
2376         https://bugs.webkit.org/show_bug.cgi?id=176672
2377         <rdar://problem/34353723>
2378
2379         Reviewed by Ryosuke Niwa.
2380
2381         Makes several tweaks to support DataTransfer.getData and DataTransfer.setData when dragging and dropping on iOS.
2382         See per-method changes below for more details. This patch also renames some old variable and property names
2383         along the way, so they no longer reference "data interaction", and instead refer to the feature by its post-WWDC
2384         name.
2385
2386         New test: DataInteractionTests.ExternalSourceInlineTextToFileInput
2387         Modified: DataInteractionTests.CanStartDragOnDivWithDraggableAttribute
2388                   DataInteractionTests.SinglePlainTextURLTypeIdentifiers
2389                   DataInteractionTests.SinglePlainTextWordTypeIdentifiers
2390
2391         * platform/ios/AbstractPasteboard.h:
2392         * platform/ios/PasteboardIOS.mm:
2393         (WebCore::cocoaTypeFromHTMLClipboardType):
2394
2395         In cocoaTypeFromHTMLClipboardType, map the "text/plain" MIME type to the "public.plain-text" UTI. Previously,
2396         this corresponded to "public.text", which is incorrect, since "public.text" also includes non-plain-text types
2397         such as "public.html", thereby confusing NSItemProviders. Importantly, this makes it so that plain text strings
2398         written via DataTransfer.setData() can actually be read back as a cocoa value, since "public.plain-text" is one
2399         of the UTIs in +[NSString readableTypeIdentifiersForItemProvider].
2400
2401         (WebCore::Pasteboard::writeString):
2402
2403         Instead of writing { type : data } to the pasteboard, write { cocoaType : data }. It appears that this was
2404         changed unintentionally in r156588 when upstreaming the iOS pasteboard implementation. This is made apparent by
2405         how Pasteboard::readString() requests the cocoa UTI from the platform pasteboard, but Pasteboard::writeString()
2406         sends the MIME type.
2407
2408         * platform/ios/PlatformPasteboardIOS.mm:
2409         (WebCore::PlatformPasteboard::filenamesForDataInteraction):
2410         (WebCore::PlatformPasteboard::write):
2411
2412         When writing plain text or a URL, specify that the item wants inline style representation. This prevents odd and
2413         unexpected behaviors (for instance, being able to drag plain text into the Files app as a file), but it also
2414         makes getData() not bail and return the null string on drop, due to forFileDrag() being true in
2415         DataTransfer::getData().
2416
2417         * platform/ios/WebItemProviderPasteboard.h:
2418         * platform/ios/WebItemProviderPasteboard.mm:
2419         (-[WebItemProviderRegistrationInfoList init]):
2420         (uiPreferredPresentationStyle):
2421         (-[WebItemProviderRegistrationInfoList itemProvider]):
2422
2423         Set the preferred presentation style when generating an item provider from a registration list.
2424
2425         (+[WebItemProviderLoadResult emptyLoadResult]):
2426         (+[WebItemProviderLoadResult loadResultWithFileURLMap:presentationStyle:]):
2427         (-[WebItemProviderLoadResult initWithFileURLMap:presentationStyle:]):
2428         (-[WebItemProviderLoadResult fileURLForType:]):
2429         (-[WebItemProviderLoadResult loadedFileURLs]):
2430         (-[WebItemProviderLoadResult loadedTypeIdentifiers]):
2431
2432         Introduce WebItemProviderLoadResult, an object that encapsulates information needed to represent the contents of
2433         an NSItemProvider dropped in web content. Previously, WebItemProviderPasteboard maintained an array of
2434         dictionaries of UTI => file URL, where each dictionary represents where the dropped data for a given item
2435         provider lives. Now that we additionally need to remember (for each item provider) whether we should consider
2436         its data as a file upload, it's more helpful to have a separate object representing the "load results" of a
2437         dropped item provider.
2438
2439         (-[WebItemProviderPasteboard init]):
2440         (-[WebItemProviderPasteboard pasteboardTypes]):
2441         (-[WebItemProviderPasteboard setItemProviders:]):
2442         (-[WebItemProviderPasteboard _preLoadedDataConformingToType:forItemProviderAtIndex:]):
2443         (-[WebItemProviderPasteboard droppedFileURLs]):
2444
2445         Respect item provider load results that should not be exposed as a file to the page.
2446
2447         (-[WebItemProviderPasteboard numberOfFiles]):
2448
2449         Respect item providers with UIPreferredPresentationStyleInline by not counting them towards the number of files.
2450
2451         (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:synchronousTimeout:]):
2452
2453         Adjust for the transition from an array of dictionaries representing loaded item providers to an array of
2454         WebItemProviderLoadResults.
2455
2456         (-[WebItemProviderPasteboard fileURLsForDataInteraction]): Deleted.
2457         * platform/mac/DragDataMac.mm:
2458         (WebCore::DragData::containsFiles const):
2459
2460         DragData::containsFiles previously only considered whether or not particular UTIs appear in the pasteboard. In
2461         the case of Mac, this is NSFilesPromisePboardType and NSFilenamesPboardType, but in the case of iOS, this is a
2462         much broader category (anything conforming to "public.content"), since files are not exposed explicitly as
2463         "promise" or "file" types in the list of registered UTIs. This caused us to always bail in
2464         DataTransfer.getData() on drop on iOS, since we will always believe there's a file on the pasteboard if there's
2465         anything conforming to "public.content" at all.
2466
2467         To fix this and simplify the code at the same time, we simply replace the currently implementation of
2468         DragData::containsFiles to return true iff the number of files is nonzero. On Mac, DragData::numberOfFiles
2469         checks the same UTIs as DragData::containsFiles (NSFilesPromisePboardType and NSFilenamesPboardType), but
2470         additionally counts the number of file URLs corresponding to those UTIs.
2471
2472         On iOS, the implementation of numberOfFiles is new to iOS 11, and relevant only in the drag and drop flow.
2473         Previously, we would consider an item provider to "contain" a file if it had a UTI conforming to one of the UTIs
2474         acceptable for drag and drop (at the time of writing, these are ["public.content", "public.zip",
2475         "public.folder"]). With this patch, anything conforming to these UTIs will continue to be represented as files,
2476         but importantly, if an item provider indicates that it should be represented inline (i.e. a plain text
2477         selection), then we don't consider that item provider as vending a file. This allows us to distinguish between
2478         cases where we are dragging a plain text selection over a file input, and when we are dragging a plain text file.
2479         In both cases, "public.plain-text" is offered as a registered UTI, but in the former, the item provider should
2480         indicate that inline presentation style is preferred. Refer to <rdar://problem/32202542> for more details.
2481
2482 2017-09-12  Joseph Pecoraro  <pecoraro@apple.com>
2483
2484         QualifiedName::init should assume AtomicStrings::init was already called
2485         https://bugs.webkit.org/show_bug.cgi?id=176639
2486
2487         Reviewed by Sam Weinig.
2488
2489         * dom/QualifiedName.cpp:
2490         (WebCore::QualifiedName::init):
2491         All callers of QualifiedName::init precede it with their own call to
2492         AtomicString::init, so QualifiedName doesn't need to do it.
2493
2494 2017-09-12  Myles C. Maxfield  <mmaxfield@apple.com>
2495
2496         Unskip fast/text/system-font-synthetic-italic.html
2497         https://bugs.webkit.org/show_bug.cgi?id=175944
2498         <rdar://problem/32864306>
2499
2500         Reviewed by Jon Lee.
2501
2502         Our buildbots now all have this symbol.
2503
2504         * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
2505         (WebCore::FontFamilySpecificationCoreText::fontRanges const):
2506
2507 2017-09-12  Myles C. Maxfield  <mmaxfield@apple.com>
2508
2509         ASSERTION FAILED: !m_valueOrException under FontFaceSet::completedLoading loading a Serious Eats page
2510         https://bugs.webkit.org/show_bug.cgi?id=175899
2511
2512         Reviewed by Tim Horton.
2513
2514         Slight style update to r221835. Also adds a test.
2515
2516         Test: fast/text/document-fonts-while-loading-crash.html
2517
2518         * css/CSSFontFaceSet.h:
2519         * css/FontFaceSet.cpp:
2520         (WebCore::FontFaceSet::FontFaceSet):
2521
2522 2017-09-12  Myles C. Maxfield  <mmaxfield@apple.com>
2523
2524         Inline ParserUtilities.h
2525         https://bugs.webkit.org/show_bug.cgi?id=176572
2526
2527         Reviewed by Darin Adler.
2528
2529         Its contents are only ever used from SVG files which also include SVGParserUtilities.h.
2530
2531         No new tests because there is no behavior change.
2532
2533         * WebCore.xcodeproj/project.pbxproj:
2534         * platform/text/ParserUtilities.h: Removed.
2535         * svg/SVGParserUtilities.h:
2536         (WebCore::skipString):
2537
2538 2017-09-12  Ryosuke Niwa  <rniwa@webkit.org>
2539
2540         Dragging & dropping a file creates an attachment element even when it's disabled
2541         https://bugs.webkit.org/show_bug.cgi?id=176769
2542
2543         Reviewed by Tim Horton.
2544
2545         The bug that dropping a file always created an attachment element even when it's disabled by settings
2546         was caused by WebContentReader::readFilenames always creating an attachment element. Fixed this by
2547         checking the runtime flag. The fix is tested by drag-files-to-editable-element-as-URLs.html
2548
2549         To fix the bug that HTMLAttachmentElement is always exposed on the global object even when it's disabled
2550         by settings, replaced the setting to enable attachment element by an equivalent runtime enabled flag,
2551         and hid both the interface as well as the element behind it. Fixed various bugs in our code generator
2552         to make this work.
2553
2554         Tests: editing/pasteboard/drag-files-to-editable-element-as-URLs.html
2555                editing/pasteboard/drag-files-to-editable-element-as-attachment.html
2556
2557         * bindings/js/WebCoreBuiltinNames.h: Added symbols used in the generated code.
2558         * dom/make_event_factory.pl:
2559         (defaultItemFactory): Replaced "runtimeConditonal" option by "runtimeEnabled".
2560         (generateImplementation):
2561         * dom/make_names.pl:
2562         (defaultTagPropertyHash):
2563         (printConstructorInterior): Return a HTMLUnknownElement if the element is disabled by a runtime flag.
2564         (printTypeHelpers): Make is<HTMLAttachmentElement>(~) returns false when the feature is disabled by
2565         checking whether the given element is an instance of HTMLUnknownElement.
2566         (printWrapperFunctions): Simplified this code by matching the code for settingsConditional.
2567         * editing/mac/EditorMac.mm:
2568         (WebCore::Editor::WebContentReader::readFilenames): Fixed the bug that this code was always creating
2569         an attachment element even when the feature is disabled.
2570         * html/HTMLAttachmentElement.idl: Hide this behind a runtime flag.
2571         * html/HTMLTagNames.in: 
2572         * page/RuntimeEnabledFeatures.h:
2573         (WebCore::RuntimeEnabledFeatures::setAttachmentElementEnabled): Added.
2574         (WebCore::RuntimeEnabledFeatures::attachmentElementEnabled const): Added.
2575         * page/Settings.in: Removed attachmentElementEnabled.
2576
2577 2017-09-12  Youenn Fablet  <youenn@apple.com>
2578
2579         Introduce a RecordData for Cache to efficiently check whether it matches a corresponding request or not
2580         https://bugs.webkit.org/show_bug.cgi?id=176579
2581
2582         Reviewed by Alex Christensen.
2583
2584         No change of behavior.
2585
2586         Introducing another version of queryCacheMatch used for the NetworkProcess implementation of the Cache.
2587         Exporting the copy of a response body to be used also there.
2588
2589         * Modules/cache/DOMCacheEngine.cpp:
2590         (WebCore::DOMCacheEngine::matchURLs):
2591         (WebCore::DOMCacheEngine::queryCacheMatch):
2592         (WebCore::DOMCacheEngine::copyResponseBody):
2593         * Modules/cache/DOMCacheEngine.h:
2594
2595 2017-09-12  Antti Koivisto  <antti@apple.com>
2596
2597         AnimationBase should point to Element instead of RenderElement
2598         https://bugs.webkit.org/show_bug.cgi?id=176807
2599
2600         Reviewed by Andreas Kling.
2601
2602         This is a step towards making animation system operate on elements and styles instead renderers.
2603
2604         No functional changes.
2605
2606         * page/animation/AnimationBase.cpp:
2607         (WebCore::AnimationBase::AnimationBase):
2608         (WebCore::AnimationBase::renderer const):
2609         (WebCore::AnimationBase::compositedRenderer const):
2610         (WebCore::AnimationBase::updateStateMachine):
2611         (WebCore::AnimationBase::fireAnimationEventsIfNeeded):
2612         (WebCore::AnimationBase::timeToNextService):
2613         (WebCore::AnimationBase::freezeAtTime):
2614         (WebCore::AnimationBase::getElapsedTime const):
2615         * page/animation/AnimationBase.h:
2616         (WebCore::AnimationBase::clear):
2617         (WebCore::AnimationBase::renderer const): Deleted.
2618         * page/animation/ImplicitAnimation.cpp:
2619         (WebCore::ImplicitAnimation::shouldSendEventForListener const):
2620         (WebCore::ImplicitAnimation::computeExtentOfTransformAnimation const):
2621         (WebCore::ImplicitAnimation::startAnimation):
2622         (WebCore::ImplicitAnimation::pauseAnimation):
2623         (WebCore::ImplicitAnimation::endAnimation):
2624         (WebCore::ImplicitAnimation::sendTransitionEvent):
2625         (WebCore::ImplicitAnimation::reset):
2626         * page/animation/KeyframeAnimation.cpp:
2627         (WebCore::KeyframeAnimation::getAnimatedStyle):
2628         (WebCore::KeyframeAnimation::computeExtentOfTransformAnimation const):
2629         (WebCore::KeyframeAnimation::startAnimation):
2630         (WebCore::KeyframeAnimation::pauseAnimation):
2631         (WebCore::KeyframeAnimation::endAnimation):
2632         (WebCore::KeyframeAnimation::shouldSendEventForListener const):
2633         (WebCore::KeyframeAnimation::sendAnimationEvent):
2634         (WebCore::KeyframeAnimation::resolveKeyframeStyles):
2635
2636 2017-09-12  Per Arne Vollan  <pvollan@apple.com>
2637
2638         [Win] Add Modules/fetch to list of forwarding headers folders.
2639         https://bugs.webkit.org/show_bug.cgi?id=176747
2640
2641         Reviewed by Brent Fulgham.
2642
2643         * PlatformWin.cmake:
2644
2645 2017-09-12  Jer Noble  <jer.noble@apple.com>
2646
2647         [MSE] Don't increase the reported totalFrameDelay for non-displayed frames (or frames coming in while paused).
2648         https://bugs.webkit.org/show_bug.cgi?id=175900
2649
2650         Reviewed by Eric Carlson.
2651
2652         When seeking to a specific time, the decompression session necessarily needs to be fed samples from before that
2653         time (i.e., all samples from the previous I-frame forward). These shouldn't contribute to the "total frame
2654         delay" metric. Neither should samples delivered when the video is paused (like, during seeking), as a frame can't
2655         be "late" if time is not moving forward.
2656
2657         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
2658         (WebCore::WebCoreDecompressionSession::handleDecompressionOutput):
2659         * platform/cf/CoreMediaSoftLink.cpp:
2660         * platform/cf/CoreMediaSoftLink.h:
2661
2662 2017-09-12  Sam Weinig  <sam@webkit.org>
2663
2664         Gtk build fix for "Finish off the FormData implementation" - https://bugs.webkit.org/show_bug.cgi?id=176659
2665
2666         * fileapi/Blob.cpp:
2667         (WebCore::Blob::Blob):
2668         * fileapi/Blob.h:
2669         * fileapi/File.cpp:
2670         (WebCore::File::File):
2671         
2672             Replace copy constructor with a tagged constructor.
2673
2674 2017-09-12  Dean Jackson  <dino@apple.com>
2675
2676         [WebGL] VideoTextureCopierCV doesn't correctly restore vertex attribute state
2677         https://bugs.webkit.org/show_bug.cgi?id=176771
2678         <rdar://problem/34386621>
2679
2680         Reviewed by Antoine Quint.
2681
2682         The OpenGL context in VideoTextureCopierCV wasn't being restored to
2683         the state it had before rendering a video to a texture. Specifically
2684         the vertex attribute values were never recorded by the state saver.
2685
2686         Update the existing test of VideoTextureCopierCV so that it is
2687         explicitly doing something different from the WebCore code, which
2688         means that state will have to be correctly restored for the test
2689         to pass.
2690
2691         * platform/graphics/cv/VideoTextureCopierCV.cpp:
2692         (WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture): Make sure
2693         to record the vertex attribute state once we know the location of the position attribute.
2694         (WebCore::VideoTextureCopierCV::GC3DStateSaver::GC3DStateSaver):
2695         (WebCore::VideoTextureCopierCV::GC3DStateSaver::~GC3DStateSaver):
2696         (WebCore::VideoTextureCopierCV::GC3DStateSaver::saveVertexAttribState): Save all the
2697         applicable vertex attribute state information.
2698         * platform/graphics/cv/VideoTextureCopierCV.h: GC3DStateSaver can use a reference
2699         to the GC3D rather than a pointer.
2700
2701 2017-09-12  Dean Jackson  <dino@apple.com>
2702
2703         [WebGL] accelerated texImage2D for video doesn't respect flipY
2704         https://bugs.webkit.org/show_bug.cgi?id=176491
2705         <rdar://problem/33833511>
2706
2707         Reviewed by Jer Noble.
2708
2709         (Take 2 - this was rolled out due to a test failure, but the following
2710         commit will fix that)
2711
2712         Previously, if UNPACK_FLIP_Y_WEBGL was set to true, we'd either fall
2713         back to software or fail to upload texture data. Fix this by intercepting
2714         the texImage2D call, checking the orientation of the video, and running
2715         a small shader program to flip it if necessary.
2716
2717         While there, implement UNPACK_PREMULTIPLY_ALPHA_WEBGL as well, although
2718         none of our media decoders support video with alpha, so unfortunately
2719         this will have no visible change.
2720
2721         Tests: fast/canvas/webgl/texImage2D-video-flipY-false.html
2722                fast/canvas/webgl/texImage2D-video-flipY-true.html
2723
2724         * platform/cocoa/CoreVideoSoftLink.cpp: Add link to CVOpenGL(ES)TextureGetCleanTexCoords,
2725         which is used to check the orientation of the source video.
2726         * platform/cocoa/CoreVideoSoftLink.h:
2727
2728         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2729         (WebCore::MediaPlayerPrivateAVFoundationObjC::copyVideoTextureToPlatformTexture): We can
2730         now handle flipped or premultiplied requests.
2731         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2732         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::copyVideoTextureToPlatformTexture): Ditto.
2733
2734         * platform/graphics/cv/VideoTextureCopierCV.cpp:
2735         (WebCore::VideoTextureCopierCV::VideoTextureCopierCV): Rename readFramebuffer to
2736         simply framebuffer.
2737         (WebCore::VideoTextureCopierCV::~VideoTextureCopierCV): Delete the program and buffer
2738         if they were created.
2739         (WebCore::VideoTextureCopierCV::initializeContextObjects): Sets up the shader program
2740         and the vertex buffer for drawing. Also records the location of the uniforms.
2741         (WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture): Create a new
2742         framebuffer object, and render the video texture into that framebuffer using a
2743         shader that can flip the coordinates.
2744         (WebCore::VideoTextureCopierCV::GC3DStateSaver::GC3DStateSaver): Helper to restore
2745         the state of the user's GraphicsContext3D while we're intercepting calls.
2746         (WebCore::VideoTextureCopierCV::GC3DStateSaver::~GC3DStateSaver):
2747         * platform/graphics/cv/VideoTextureCopierCV.h:
2748
2749         * platform/graphics/GraphicsContext3D.h: Add two new entry points, for direct shader
2750         compilation and attribute access. This avoids going through ANGLE.
2751         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2752         (WebCore::GraphicsContext3D::compileShader):
2753         (WebCore::GraphicsContext3D::compileShaderDirect):
2754         (WebCore::GraphicsContext3D::getAttribLocationDirect):
2755
2756 2017-09-12  Manuel Rego Casasnovas  <rego@igalia.com>
2757
2758         [css-grid] Stretching auto tracks should be done as part of the track sizing algorithm
2759         https://bugs.webkit.org/show_bug.cgi?id=176783
2760
2761         Reviewed by Sergio Villar Senin.
2762
2763         CSS WG has agreed to modify the track sizing algorithm to include
2764         a new step: https://drafts.csswg.org/css-grid/#algo-stretch
2765         We used to do the stretch of the "auto" tracks at the end of
2766         the track sizing algorithm, however this change integrates it
2767         into the algorithm itself as the last step.
2768         See: https://github.com/w3c/csswg-drafts/issues/1150
2769
2770         The patch moves the method
2771         RenderGrid::applyStretchAlignmentToTracksIfNeeded() to
2772         GridTrackSizingAlgorithm::stretchAutoTracks().
2773         And then modifies the grid track sizing algorithm to execute
2774         the new step.
2775
2776         This patch uses the WPT test updated to check the new behavior.
2777
2778         * rendering/GridTrackSizingAlgorithm.cpp:
2779         (WebCore::GridTrackSizingAlgorithm::initializeTrackSizes): Initialize
2780         the list of auto tracks.
2781         (WebCore::GridTrackSizingAlgorithm::stretchFlexibleTracks): Add
2782         early return if there are not flexible tracks.
2783         (WebCore::GridTrackSizingAlgorithm::stretchAutoTracks): Code moved from
2784         RenderGrid::applyStretchAlignmentToTracksIfNeeded().
2785         (WebCore::GridTrackSizingAlgorithm::setup): Reset list of auto tracks.
2786         (WebCore::GridTrackSizingAlgorithm::run): Add new step
2787         stretchAutoTracks().
2788         (WebCore::GridTrackSizingAlgorithm::reset): Reset auto tracks.
2789         * rendering/GridTrackSizingAlgorithm.h: Add m_autoSizedTracksIndex.
2790         * rendering/RenderGrid.cpp:
2791         (WebCore::RenderGrid::layoutBlock): Avoid applying stretch here.
2792         (WebCore::RenderGrid::contentAlignmentNormalBehaviorGrid): Make public.
2793         (WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded): Moved to
2794         GridTrackSizingAlgorithm::stretchAutoTracks().
2795         * rendering/RenderGrid.h:
2796
2797 2017-09-12  Eric Carlson  <eric.carlson@apple.com>
2798
2799         Switch MediaPlayerPrivateAVFoundation to release logging
2800         https://bugs.webkit.org/show_bug.cgi?id=176621
2801         <rdar://problem/34335311>
2802
2803         Reviewed by Jer Noble.
2804
2805         * html/HTMLMediaElement.h:
2806         * platform/graphics/MediaPlayer.cpp:
2807         (WebCore::nullLogger):
2808         (WebCore::MediaPlayer::mediaPlayerLogger):
2809         * platform/graphics/MediaPlayer.h:
2810         (WebCore::MediaPlayerClient::mediaPlayerLogIdentifier):
2811         (WebCore::MediaPlayerClient::mediaPlayerLogger):
2812         (WebCore::MediaPlayer::mediaPlayerLogIdentifier):
2813         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
2814         (WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation):
2815         (WebCore::MediaPlayerPrivateAVFoundation::~MediaPlayerPrivateAVFoundation):
2816         (WebCore::MediaPlayerPrivateAVFoundation::setUpVideoRendering):
2817         (WebCore::MediaPlayerPrivateAVFoundation::tearDownVideoRendering):
2818         (WebCore::MediaPlayerPrivateAVFoundation::load):
2819         (WebCore::MediaPlayerPrivateAVFoundation::playabilityKnown):
2820         (WebCore::MediaPlayerPrivateAVFoundation::prepareToPlay):
2821         (WebCore::MediaPlayerPrivateAVFoundation::play):
2822         (WebCore::MediaPlayerPrivateAVFoundation::pause):
2823         (WebCore::MediaPlayerPrivateAVFoundation::durationMediaTime const):
2824         (WebCore::MediaPlayerPrivateAVFoundation::seekWithTolerance):
2825         (WebCore::MediaPlayerPrivateAVFoundation::setNaturalSize):
2826         (WebCore::MediaPlayerPrivateAVFoundation::maxMediaTimeSeekable const):
2827         (WebCore::MediaPlayerPrivateAVFoundation::minMediaTimeSeekable const):
2828         (WebCore::MediaPlayerPrivateAVFoundation::updateStates):
2829         (WebCore::MediaPlayerPrivateAVFoundation::rateChanged):
2830         (WebCore::MediaPlayerPrivateAVFoundation::timeChanged):
2831         (WebCore::MediaPlayerPrivateAVFoundation::seekCompleted):
2832         (WebCore::MediaPlayerPrivateAVFoundation::invalidateCachedDuration):
2833         (WebCore::MediaPlayerPrivateAVFoundation::setPreload):
2834         (WebCore::MediaPlayerPrivateAVFoundation::mainThreadCallback):
2835         (WebCore::MediaPlayerPrivateAVFoundation::scheduleMainThreadNotification):
2836         (WebCore::MediaPlayerPrivateAVFoundation::dispatchNotification):
2837         (WebCore::MediaPlayerPrivateAVFoundation::processNewAndRemovedTextTracks):
2838         (WebCore::MediaPlayerPrivateAVFoundation::logChannel const):
2839         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
2840         (WebCore::MediaPlayerPrivateAVFoundation::logClassName const):
2841         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2842         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2843         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCache):
2844         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCacheForOrigins):
2845         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
2846         (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageGenerator):
2847         (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyImageGenerator):
2848         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
2849         (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoLayer):
2850         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
2851         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
2852         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
2853         (WebCore::MediaPlayerPrivateAVFoundationObjC::checkPlayability):
2854         (WebCore::MediaPlayerPrivateAVFoundationObjC::beginLoadingMetadata):
2855         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMedia const):
2856         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformPlay):
2857         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformPause):
2858         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformDuration const):
2859         (WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime):
2860         (WebCore::MediaPlayerPrivateAVFoundationObjC::setMuted):
2861         (WebCore::MediaPlayerPrivateAVFoundationObjC::setClosedCaptionsVisible):
2862         (WebCore::MediaPlayerPrivateAVFoundationObjC::assetStatus const):
2863         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithImageGenerator):
2864         (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageForTimeInRect):
2865         (WebCore::MediaPlayerPrivateAVFoundationObjC::getSupportedTypes):
2866         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
2867         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateAudioTracks):
2868         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoTracks):
2869         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput):
2870         (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoOutput):
2871         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage):
2872         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
2873         (WebCore::MediaPlayerPrivateAVFoundationObjC::createOpenGLVideoOutput):
2874         (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyOpenGLVideoOutput):
2875         (WebCore::MediaPlayerPrivateAVFoundationObjC::waitForVideoOutputMediaDataWillChange):
2876         (WebCore::MediaPlayerPrivateAVFoundationObjC::processMediaSelectionOptions):
2877         (WebCore::MediaPlayerPrivateAVFoundationObjC::flushCues):
2878         (WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack):
2879         (WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack const):
2880         (WebCore::MediaPlayerPrivateAVFoundationObjC::isCurrentPlaybackTargetWireless const):
2881         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetName const):
2882         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessVideoPlaybackDisabled const):
2883         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessVideoPlaybackDisabled):
2884         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget):
2885         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget):
2886         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldBufferData):
2887         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
2888         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
2889         (WebCore::boolString): Deleted.
2890
2891 2017-09-12  Daniel Bates  <dabates@apple.com>
2892
2893         REGRESSION (r215784): The title of right-to-left pages are empty
2894         https://bugs.webkit.org/show_bug.cgi?id=176746
2895         <rdar://problem/34211419>
2896
2897         Reviewed by Brent Fulgham.
2898
2899         Left truncate a long right-to-left title.
2900
2901         Right-to-left text represents the visual ordering of text. Internally WebKit stores
2902         right-to-left text identically to left-to-right text in memory. So, we can use the
2903         same string operation to truncate right-to-left text as we do to truncate left-to-right
2904         text.
2905
2906         * platform/text/StringWithDirection.h:
2907         (WebCore::truncateFromEnd):
2908
2909 2017-09-12  Chris Fleizach  <cfleizach@apple.com>
2910
2911         AX: On generic container elements, WebKit should distinguish between tooltip (e.g. @title) and label (e.g. @aria-label) attributes
2912         https://bugs.webkit.org/show_bug.cgi?id=170475
2913         <rdar://problem/31439222>
2914
2915         Reviewed by Joanmarie Diggs.
2916
2917         Test: accessibility/title-tag-on-unimportant-elements-is-help-text.html
2918
2919         * accessibility/AccessibilityNodeObject.cpp:
2920         (WebCore::AccessibilityNodeObject::helpText):
2921         (WebCore::AccessibilityNodeObject::accessibilityDescription):
2922         (WebCore::AccessibilityNodeObject::roleIgnoresTitle):
2923         * accessibility/AccessibilityNodeObject.h:
2924
2925 2017-09-12  Brent Fulgham  <bfulgham@apple.com>
2926
2927         Show punycode to user if a URL mixes Armenian Seh or Vo with other scripts
2928         https://bugs.webkit.org/show_bug.cgi?id=176578
2929         <rdar://problem/33906231>
2930
2931         Reviewed by Alex Christensen.
2932
2933         Revise our "lookalike character" logic to include the Armenian Vo and Seh
2934         characters, which can be mistaken for 'n' and 'v' when displayed in
2935         certain fonts.
2936
2937         Tested by new API tests.
2938
2939         * platform/mac/WebCoreNSURLExtras.mm:
2940         (WebCore::isArmenianLookalikeCharacter): Added utility function.
2941         (WebCore::isArmenianScriptCharacter): Ditto.
2942         (WebCore::isLookalikeCharacter): Handle Armenian-lookalike cases.
2943
2944 2017-09-12  Antti Koivisto  <antti@apple.com>
2945
2946         Remove RenderElement::isCSSAnimating boolean
2947         https://bugs.webkit.org/show_bug.cgi?id=176779
2948
2949         Reviewed by Andreas Kling.
2950
2951         This optimization can be replaced with a simple style test that doesn't require keeping
2952         two sources of truth in sync.
2953
2954         * page/animation/CSSAnimationController.cpp:
2955         (WebCore::CSSAnimationControllerPrivate::ensureCompositeAnimation):
2956         (WebCore::CSSAnimationControllerPrivate::clear):
2957
2958             Can't test here as style might have become non-animating and we don't clear animation when that happens.
2959             This is only called on renderer destruction so it is not an important optimization.
2960
2961         (WebCore::CSSAnimationControllerPrivate::isRunningAnimationOnRenderer const):
2962         (WebCore::CSSAnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer const):
2963         (WebCore::CSSAnimationControllerPrivate::getAnimatedStyleForRenderer):
2964         (WebCore::CSSAnimationControllerPrivate::computeExtentOfAnimation const):
2965         (WebCore::CSSAnimationController::cancelAnimations):
2966         (WebCore::CSSAnimationController::getAnimatedStyleForRenderer):
2967         (WebCore::CSSAnimationController::computeExtentOfAnimation const):
2968         (WebCore::CSSAnimationController::isRunningAnimationOnRenderer const):
2969         (WebCore::CSSAnimationController::isRunningAcceleratedAnimationOnRenderer const):
2970
2971             Test if the style has any animations. This is roughly equivalent of the old test.
2972             (it is actually somewhat better as the boolean was never cleared on style changes)
2973
2974         * rendering/RenderElement.cpp:
2975         (WebCore::RenderElement::RenderElement):
2976         * rendering/RenderElement.h:
2977         (WebCore::RenderElement::isCSSAnimating const): Deleted.
2978         (WebCore::RenderElement::setIsCSSAnimating): Deleted.
2979         * rendering/style/RenderStyle.h:
2980         (WebCore::RenderStyle::hasAnimationsOrTransitions const):
2981
2982 2017-09-12  Ms2ger  <Ms2ger@igalia.com>
2983
2984         Disallow passing null data to uniform1uiv() and friends.
2985         https://bugs.webkit.org/show_bug.cgi?id=176777
2986
2987         Reviewed by Sam Weinig.
2988
2989         This matches the specification as well as Gecko and Chromium.
2990
2991         Test: fast/canvas/webgl/webgl2/bindings.html
2992
2993         * html/canvas/WebGL2RenderingContext.idl:
2994
2995 2017-09-12  Sam Weinig  <sam@webkit.org>
2996
2997         [Cleanup] Follow up cleanup for DOMFormData implementation
2998         https://bugs.webkit.org/show_bug.cgi?id=176740
2999
3000         Reviewed by Alex Christensen.
3001
3002         - Merges FormDataList into DOMFormData.
3003         - Streamline / refactor FormData creation from DOMFormData.
3004
3005         * CMakeLists.txt:
3006         * WebCore.xcodeproj/project.pbxproj:
3007         * html/FormDataList.cpp: Removed.
3008         * html/FormDataList.h: Removed.
3009
3010             Remove FormDataList.
3011
3012         * html/DOMFormData.cpp:
3013         (WebCore::DOMFormData::DOMFormData):
3014         (WebCore::DOMFormData::createFileEntry):
3015         (WebCore::DOMFormData::append):
3016         (WebCore::DOMFormData::set):
3017         (WebCore::DOMFormData::Iterator::next):
3018         * html/DOMFormData.h:
3019         (WebCore::DOMFormData::items const):
3020         (WebCore::DOMFormData::encoding const):
3021
3022             Merge FormDataList into DOMFormData. FormDataList's additional
3023             appendData/appendBlob functions have been removed, and their
3024             functionality inlined into DOMFormData's append functions. 
3025
3026             Adopted makeKeyValuePair in DOMFormData::Iterator::next().
3027
3028         * platform/network/FormData.cpp:
3029         (WebCore::FormData::create):
3030         (WebCore::FormData::createMultiPart):
3031         (WebCore::normalizeStringData):
3032         (WebCore::FormData::appendMultiPartFileValue):
3033         (WebCore::FormData::appendMultiPartStringValue):
3034         (WebCore::FormData::appendMultiPartKeyValuePairItems):
3035         (WebCore::FormData::appendNonMultiPartKeyValuePairItems):
3036         (WebCore::FormData::appendKeyValuePairItems): Deleted.
3037         * platform/network/FormData.h:
3038
3039             Split-up appendKeyValuePairItems into separate multipart and non-multipart
3040             functions, as the two edges of the branch didn't share much in common. Further
3041             split out multipart file and multipart string appending, since they too did not
3042             share that much in common and makes the code easier to follow. 
3043
3044             String value normalization has been moved entirely here (previously it was a member 
3045             function of FormDataList) as FormData is the only user.
3046
3047         * xml/XMLHttpRequest.cpp:
3048         (WebCore::XMLHttpRequest::send):
3049         * loader/FormSubmission.cpp:
3050         (WebCore::FormSubmission::create):
3051         * Modules/fetch/FetchBody.cpp:
3052         (WebCore::FetchBody::extract):
3053         
3054             Update for new FormData create functions which don't need the
3055             encoding passed explicitly, since it is part of the DOMFormData.
3056         
3057         * html/BaseButtonInputType.cpp:
3058         * html/BaseButtonInputType.h:
3059         * html/BaseCheckableInputType.cpp:
3060         * html/BaseCheckableInputType.h:
3061         * html/FileInputType.cpp:
3062         * html/FileInputType.h:
3063         * html/FormAssociatedElement.h:
3064         * html/HTMLButtonElement.cpp:
3065         * html/HTMLButtonElement.h:
3066         * html/HTMLFormControlElement.h:
3067         * html/HTMLInputElement.cpp:
3068         * html/HTMLInputElement.h:
3069         * html/HTMLKeygenElement.cpp:
3070         * html/HTMLKeygenElement.h:
3071         * html/HTMLMeterElement.cpp:
3072         * html/HTMLObjectElement.cpp:
3073         * html/HTMLObjectElement.h:
3074         * html/HTMLSelectElement.cpp:
3075         * html/HTMLSelectElement.h:
3076         * html/HTMLTextAreaElement.cpp:
3077         * html/HTMLTextAreaElement.h:
3078         * html/HiddenInputType.cpp:
3079         * html/HiddenInputType.h:
3080         * html/ImageInputType.cpp:
3081         * html/ImageInputType.h:
3082         * html/InputType.cpp:
3083         * html/InputType.h:
3084         * html/SubmitInputType.cpp:
3085         * html/SubmitInputType.h:
3086         * html/TextFieldInputType.cpp:
3087         * html/TextFieldInputType.h:
3088
3089             Update to use DOMFormData directly, rather than the FormDataList, which 
3090             has been removed.
3091
3092         * page/csp/ContentSecurityPolicy.cpp:
3093
3094             Remove unnecessary #include of unused (and now removed) FormDataList.h
3095
3096 2017-09-12  Zan Dobersek  <zdobersek@igalia.com>
3097
3098         [EME] Implement CDMInstanceClearKey::requestLicense()
3099         https://bugs.webkit.org/show_bug.cgi?id=176773
3100
3101         Reviewed by Xabier Rodriguez-Calvar.
3102
3103         Implement the requestLicense() method for CDMInstanceClearKey. Per
3104         the specification, the session ID must be a 32-bit numerical value.
3105         A session ID value counter is thus kept in a static uint32_ object
3106         and incremented upon each call of requestLicense(). Init data and
3107         the session ID value are then embedded in the asynchronous dispatch
3108         that invokes the callback. That invocation now also passes along the
3109         init data, the session ID in string format, and Succeeded to now
3110         indicate the operation was completed successfully.
3111
3112         No new tests -- expectations for the relevant tests are updated
3113         to reflect the introduced changes.
3114
3115         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
3116         (WebCore::CDMInstanceClearKey::requestLicense):
3117
3118 2017-09-12  Manuel Rego Casasnovas  <rego@igalia.com>
3119
3120         [css-grid] Use transferred size over content size for automatic minimum size
3121         https://bugs.webkit.org/show_bug.cgi?id=176688
3122
3123         Reviewed by Sergio Villar Senin.
3124
3125         CSS WG has agreed to modify the spec so now the transferred size is used
3126         (if it exists) independently if it's bigger or smaller
3127         than the content size.
3128         See: https://github.com/w3c/csswg-drafts/issues/1149
3129
3130         The spec text (https://drafts.csswg.org/css-grid/#min-size-auto):
3131           "The automatic minimum size for a grid item in a given dimension is
3132            its specified size if it exists, otherwise its transferred size
3133            if that exists, else its content size"
3134
3135         This patch use the WPT tests updated to check the new behavior.
3136
3137         * rendering/GridTrackSizingAlgorithm.cpp:
3138         (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
3139         Modified so it always returns the transferred size (if any).
3140
3141 2017-09-12  Fujii Hironori  <Hironori.Fujii@sony.com>
3142
3143         [Freetype] Doesn't support coloured fonts
3144         https://bugs.webkit.org/show_bug.cgi?id=156579
3145
3146         Reviewed by Michael Catanzaro.
3147
3148         Covered by existing tests. This needs a large rebaseline that will be done in follow up commits.
3149
3150         * platform/graphics/FontCascade.h: Enable advance text rendering mode by default.
3151         (WebCore::FontCascade::advancedTextRenderingMode const):
3152         (WebCore::FontCascade::computeRequiresShaping const):
3153         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
3154         (WebCore::Font::platformInit): Do not get metrics from OS/2 table for non-scalable fonts.
3155         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
3156         (WebCore::harfBuzzGetGlyph): Use U8_APPEND_UNSAFE() instead of converting to a String and then encoding it with
3157         UTF8Encoding().
3158
3159 2017-09-12  Frederic Wang  <fwang@igalia.com>
3160
3161         Remove unnecessary virtual keyword from JS test files
3162         https://bugs.webkit.org/show_bug.cgi?id=176683
3163
3164         Reviewed by Simon Fraser.
3165
3166         JS bindings headers do not comply with the WebKit coding style since they use both the
3167         "virtual" and "override" keywords. This patch modifies the generator script to only use
3168         "override" and regenerates the bindings accordingly.
3169
3170         No new tests, behavior unchanged.
3171
3172         * bindings/scripts/CodeGeneratorJS.pm:
3173         * bindings/scripts/test/JS/JSTestCallbackFunction.h:
3174         * bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.h:
3175         * bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.h:
3176         * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h:
3177         * bindings/scripts/test/JS/JSTestCallbackInterface.h:
3178         * bindings/scripts/test/JS/JSTestVoidCallbackFunction.h:
3179
3180 2017-09-11  Wenson Hsieh  <wenson_hsieh@apple.com>
3181
3182         [iOS DnD] Support DataTransfer.setDragImage when starting a drag on iOS
3183         https://bugs.webkit.org/show_bug.cgi?id=176721
3184         <rdar://problem/34373660>
3185
3186         Reviewed by Tim Horton.
3187
3188         Adds support for setting the drag lift preview frame in the case where DataTransfer.setDragImage is being used
3189         to override the default drag preview. Currently, the frame of the drag preview we supply in this case is the
3190         same as the bounds of the source element in root view coordinates, but this means that any custom drag image
3191         the page supplies will be stretched to fill the frame of the source element. Instead, when handling a DHTML drag,
3192         position the lift and cancel drag previews relative to the event location, respecting any drag offset specified
3193         in setDragImage. The size of this preview matches the size of the drag image source (since this is all in root
3194         view coordinates, this means the drag preview will also enlarge if the user pinches to zoom in). If a
3195         disconnected image source element was provided, then we just fall back to the image size.
3196
3197         Additionally, renames DragItem's elementBounds to dragPreviewFrameInRootViewCoordinates to better reflect the
3198         purpose of this variable. This patch also introduces API test plumbing to grab targeted drag previews from the
3199         drag interaction delegate (i.e. WKContentView), and uses this in a new API test that checks the frame of the
3200         resulting UITargetedDragPreview after initiating a drag in various circumstances (see changes in Tools/ for more
3201         detail).
3202
3203         Test: DataInteractionTests.DragLiftPreviewDataTransferSetDragImage
3204
3205         * dom/DataTransfer.cpp:
3206         (WebCore::DataTransfer::dragImageElement const):
3207         * dom/DataTransfer.h:
3208         * page/DragController.cpp:
3209         (WebCore::dragLocForDHTMLDrag):
3210
3211         The logic to flip the y offset when computing the drag location is only relevant on Mac, but currently, this is
3212         guarded by #if PLATFORM(COCOA), which causes the y offset to shift the drag image in the opposite direction on
3213         iOS. To fix this, simply change the platform define to Mac.
3214
3215         (WebCore::DragController::doSystemDrag):
3216         * platform/DragItem.h:
3217         (WebCore::DragItem::encode const):
3218         (WebCore::DragItem::decode):
3219
3220 2017-09-11  Wenson Hsieh  <wenson_hsieh@apple.com>
3221
3222         [iOS WK2] Support tapping to add items to the current drag session in web content
3223         https://bugs.webkit.org/show_bug.cgi?id=176421
3224         <rdar://problem/31144674>
3225
3226         Reviewed by Tim Horton.
3227
3228         Refactors some drag initiation logic to handle starting a drag when data has already been written to the
3229         pasteboard (in the case of iOS, WebItemProviderPasteboard). See annotated comments below for more detail.
3230
3231         Tests: DataInteractionTests.AdditionalLinkAndImageIntoContentEditable
3232
3233         * page/DragActions.h:
3234         * page/DragController.cpp:
3235         (WebCore::DragController::startDrag):
3236
3237         Add a HasNonDefaultPasteboardData argument here, and replace checks for !dataTransfer.pasteboard().hasData()
3238         with checks for whether the argument is HasNonDefaultPasteboardData::No. These checks for Pasteboard::hasData()
3239         currently prevent us from overwriting custom pasteboard data, in the case that the page has written pasteboard
3240         data using the event's DataTransfer. However, in the case of adding additional drag items to the session, we
3241         will already have pasteboard data, so these checks will prevent us from writing default data to the pasteboard.
3242         See EventHandler::handleDrag for more detail.
3243
3244         * page/DragController.h:
3245         * page/DragState.h:
3246
3247         Remove the draggedContentRange member from DragState. See below.
3248
3249         * page/EventHandler.cpp:
3250         (WebCore::removeDraggedContentDocumentMarkersFromAllFramesInPage):
3251
3252         Simplify the handling of dragged content range markers. Instead of storing the DOM Range being dragged and
3253         removing/repainting the range after dragging ends, just repaint the contentRenderer of the frame being dragged.
3254         When the dragging session has completely ended, remove all dragged content ranges from the page's mainframe and
3255         all of its subframes, and repaint everything.
3256
3257         (WebCore::EventHandler::dragCancelled):
3258         (WebCore::EventHandler::didStartDrag):
3259         (WebCore::EventHandler::dragSourceEndedAt):
3260
3261         Add a MayExtendDragSession argument, indicating whether or not the web process will attempt to continue the drag
3262         session, in which case EventHandler::dragSourceEndedAt should not remove any existing dragged content range
3263         document markers.
3264
3265         (WebCore::EventHandler::dispatchDragStartEvent):
3266
3267         Helper method to dispatch a `dragstart` event, return whether or not to proceed with the drag, and also compute
3268         (as an outparam) whether or not custom pasteboard data was written during the event.
3269
3270         (WebCore::EventHandler::handleDrag):
3271
3272         If custom data was written during `dragstart`, pass along HasNonDefaultPasteboardData::Yes when calling
3273         DragController::startDrag.
3274
3275         (WebCore::repaintContentsOfRange): Deleted.
3276         * page/EventHandler.h:
3277         * page/ios/EventHandlerIOS.mm:
3278         (WebCore::EventHandler::tryToBeginDataInteractionAtPoint):
3279         * platform/Pasteboard.h:
3280         * platform/ios/PasteboardIOS.mm:
3281         (WebCore::Pasteboard::changeCount const):
3282         * platform/ios/WebItemProviderPasteboard.mm:
3283         (-[WebItemProviderPasteboard setItemProviders:]):
3284
3285         Stop clearing out the staged item provider registration list when setting item providers. After refactoring in
3286         r221595, staged registration lists are now automatically cleared out when (1) the drag-and-drop interaction
3287         state is cleared out in the UI process, or (2) when the registration list is taken by WKContentView (see
3288         -takeRegistrationList) when generating an item provider.
3289
3290         * platform/mac/PasteboardMac.mm:
3291         (WebCore::Pasteboard::changeCount const):
3292
3293         Add a changeCount method to Pasteboard on Cocoa platforms (Mac, iOS) which support changeCount natively. In
3294         theory, there's no reason Windows, GTK and WPE ports can't also implement a similar mechanism in
3295         PlatformPasteboard, but this isn't needed for anything yet. Upon dragstart, it is safe to assume that the
3296         pasteboard has been cleared on these platforms, so checking for Pasteboard::hasData (as we do for all platforms
3297         currently) is sufficient.
3298
3299 2017-09-11  Ryan Haddad  <ryanhaddad@apple.com>
3300
3301         Unreviewed, rolling out r221762.
3302
3303         This change caused flakiness in a webgl LayoutTest.
3304
3305         Reverted changeset:
3306
3307         "[WebGL] accelerated texImage2D for video doesn't respect
3308         flipY"
3309         https://bugs.webkit.org/show_bug.cgi?id=176491
3310         http://trac.webkit.org/changeset/221762
3311
3312 2017-09-11  Per Arne Vollan  <pvollan@apple.com>
3313
3314         [Win] Add Modules/cache to list of forwarding headers folders.
3315         https://bugs.webkit.org/show_bug.cgi?id=176737
3316
3317         Reviewed by Alex Christensen.
3318
3319         * PlatformWin.cmake:
3320
3321 2017-09-11  Joanmarie Diggs  <jdiggs@igalia.com>
3322
3323         AX: [ATK] aria-autocomplete not exposed on comboboxes
3324         https://bugs.webkit.org/show_bug.cgi?id=176724
3325
3326         Reviewed by Chris Fleizach.
3327
3328         Add a check to AccessibilityObject::supportsARIAAutoComplete() for
3329         combobox because isARIATextControl() returns false for that role.
3330
3331         Add new combobox test cases to existing aria-autocomplete.html test.
3332
3333         * accessibility/AccessibilityObject.cpp:
3334         (WebCore::AccessibilityObject::supportsARIAAutoComplete const):
3335
3336 2017-09-11  Ryan Haddad  <ryanhaddad@apple.com>
3337
3338         Unreviewed, rolling out r221854.
3339
3340         The test added with this change fails on 32-bit JSC bots.
3341
3342         Reverted changeset:
3343
3344         "[DFG] Optimize WeakMap::get by adding intrinsic and fixup"
3345         https://bugs.webkit.org/show_bug.cgi?id=176010
3346         http://trac.webkit.org/changeset/221854
3347
3348 2017-09-11  Dean Jackson  <dino@apple.com>
3349
3350         [WebGL macOS] No need to multisample when blitting into WebGLLayer
3351         https://bugs.webkit.org/show_bug.cgi?id=176666
3352         <rdar://problem/27774626>
3353
3354         Reviewed by Sam Weinig.
3355
3356         We were seeing performance profiles suggesting WebGL was
3357         doing 8x MSAA, even though we explicitly set it to only
3358         use 4 samples in the GLPixelFormatObj used to create
3359         the WebGL CGLContextObj. However, that same CGLPixelFormatObj
3360         was also used for the WebGLLayer's CGLContextObj, meaning the
3361         blit of the WebGL FBO into the WebGLLayer's backing store was
3362         multisampling as well -- so an extra 4 samples on top of the
3363         original 4, making it look like we were doing 8x.
3364
3365         This was obviously unnecessary, since we already have the
3366         multisampled FBO and just want to copy it, as is, into the layer.
3367
3368         Now, instead of copying the CGLPixelFormatObj, we create
3369         a new one and copy most of the attributes, leaving out
3370         the multisample flags (and the depth buffer, since we're
3371         only doing 2d blits).
3372
3373         Covered by existing WebGL tests, since there should be no
3374         visible change.
3375
3376         * platform/graphics/cocoa/WebGLLayer.mm:
3377         (-[WebGLLayer copyCGLPixelFormatForDisplayMask:]): Create a new
3378         CGLPixelFormatObj that copies most of the values from
3379         the corresponding object on the WebGL's backing CGLContextObj.
3380
3381 2017-09-11  Zan Dobersek  <zdobersek@igalia.com>
3382
3383         [EME] ClearKey: implement CDMInstanceClearKey state modifiers, callback dispatches
3384         https://bugs.webkit.org/show_bug.cgi?id=176687
3385
3386         Reviewed by Xabier Rodriguez-Calvar.
3387
3388         Implement the state modification methods on the CDMInstanceClearKey class.
3389         Initialization method is a no-op, but returns Succeeded. Distinctive
3390         identifier and persistent state setters return Succeeded if the passed-in
3391         value is false. setServerCertificate() still returns Failed due to server
3392         certificates not being supported in this ClearKey implementation.
3393
3394         The license and session operation methods are also implemented, but for
3395         now the implementations simply schedule a main thread dispatch that
3396         invokes the callback with failure-indicating values. This avoids various
3397         tests timing out, instead preferring that the tests for now fail with an
3398         exception (in most cases NotSupportedError).
3399
3400         No new tests -- relevant tests have baselines updated.
3401
3402 &n