[css-align] Implement the place-items shorthand
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-04-05  Javier Fernandez  <jfernandez@igalia.com>
2
3         [css-align] Implement the place-items shorthand
4         https://bugs.webkit.org/show_bug.cgi?id=168847
5
6         Reviewed by David Hyatt.
7
8         The CSS Box Alignment specification defines a new shorthand to set the
9         Content Alignment properties (align-items and justify-items) at the
10         same time.
11
12         This patch provides the implementation of the CSS parsing logic and the
13         required regression tests. For the time being, as it happens with the
14         rest of the new alignment properties, the new parsing logic is
15         implemented behind the CSS Grid Layout runtime flag.
16
17         Test: css3/parse-place-items.html
18
19         * css/CSSComputedStyleDeclaration.cpp:
20         (WebCore::ComputedStyleExtractor::propertyValue):
21         * css/CSSProperties.json:
22         * css/StyleProperties.cpp:
23         (WebCore::StyleProperties::getPropertyValue):
24         (WebCore::StyleProperties::getAlignmentShorthandValue):
25         * css/StyleProperties.h:
26         * css/parser/CSSPropertyParser.cpp:
27         (WebCore::isAutoOrNormalOrStretch):
28         (WebCore::consumeSelfPositionOverflowPosition):
29         (WebCore::consumeSimplifiedItemPosition):
30         (WebCore::CSSPropertyParser::consumePlaceItemsShorthand):
31         * css/parser/CSSPropertyParser.h:
32
33 2017-04-05  Ryan Haddad  <ryanhaddad@apple.com>
34
35         Unreviewed, rolling out r214932.
36
37         This change broke an internal build.
38
39         Reverted changeset:
40
41         "[ios-simulator] API test WebKit2.DataDetectionReferenceDate
42         timing out"
43         https://bugs.webkit.org/show_bug.cgi?id=161967
44         http://trac.webkit.org/changeset/214932
45
46 2017-04-05  Ryan Haddad  <ryanhaddad@apple.com>
47
48         Unreviewed, rolling out r214962.
49
50         Roll r214937 back in because it wasn't at fault for the build
51         breakage.
52
53         Reverted changeset:
54
55         "Unreviewed, rolling out r214937."
56         https://bugs.webkit.org/show_bug.cgi?id=170365
57         http://trac.webkit.org/changeset/214962
58
59 2017-04-05  Ryan Haddad  <ryanhaddad@apple.com>
60
61         Unreviewed, rolling out r214937.
62
63         This change broke an internal build.
64
65         Reverted changeset:
66
67         "REGRESSION (r202472): Data Detection overwrites existing
68         links in detected ranges"
69         https://bugs.webkit.org/show_bug.cgi?id=170365
70         http://trac.webkit.org/changeset/214937
71
72 2017-04-05  Carlos Alberto Lopez Perez  <clopez@igalia.com>
73
74         [WebRTC][OpenWebRTC] Add support for SDP BUNDLE ("a:group:BUNDLE" and "a=bundle-only" lines)
75         https://bugs.webkit.org/show_bug.cgi?id=170157
76
77         Reviewed by Alejandro G. Castro.
78
79         This implements support on the SDPProcessor for generating an "a=group:BUNDLE"
80         attribute with the MID identifiers specified in the bundle group in the most
81         recent answer.
82         It also implements support for generating "a=bundle-only" attributes on the
83         "m=" sections of the SDP according to the bundlePolicy defined.
84
85         Test: fast/mediastream/RTCPeerConnection-inspect-offer-bundlePolicy-bundle-only.html
86
87         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
88         (WebCore::MediaEndpointPeerConnection::createOfferTask):
89         (WebCore::MediaEndpointPeerConnection::createAnswerTask):
90         * Modules/mediastream/SDPProcessor.cpp:
91         (WebCore::getBundlePolicyName):
92         (WebCore::configurationToJSON):
93         * Modules/mediastream/sdp.js:
94         (SDP.generate):
95         * platform/mediastream/MediaEndpointSessionConfiguration.h:
96         (WebCore::MediaEndpointSessionConfiguration::bundlePolicy):
97         (WebCore::MediaEndpointSessionConfiguration::setBundlePolicy):
98         (WebCore::MediaEndpointSessionConfiguration::clone):
99
100 2017-04-05  Jer Noble  <jer.noble@apple.com>
101
102         [MSE] Seeks to currentTime=0 will fail if currentTime is already 0.
103         https://bugs.webkit.org/show_bug.cgi?id=170510
104         <rdar://problem/30988403>
105
106         Reviewed by Eric Carlson.
107
108         Test: media/media-source/media-source-unnecessary-seek-seeked.html
109
110         The AVSampleBufferRenderSynchronizer won't fire a time jumped notification if no seek is actully
111         necessary. So short circuit the seek logic if the seek time is identical to the current synchronizer
112         time.
113
114         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
115         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):
116
117 2017-04-05  Chris Dumez  <cdumez@apple.com>
118
119         <input type="range"> changing to disabled while active breaks all pointer events
120         https://bugs.webkit.org/show_bug.cgi?id=170447
121         <rdar://problem/31442875>
122
123         Reviewed by Geoffrey Garen.
124
125         When a range's slider is being moved, we set SliderThumbElement's m_inDragMode flag
126         to true and mark the range elements as the CapturingMouseEventsElement. When we get
127         the mouseUp event, we are supposed to exit drag mode. However, when the range element
128         gets disabled while dragging, we do not get the mouseUp event and we need to make
129         sure we exit dragging mode anyway. r112547 tried to fix this by calling stopDragging()
130         in SliderThumbElement::defaultEventHandler() when the input element is disabled.
131         While this often works, this is fragile and we sometimes fail to exit dragging mode
132         when we should.
133
134         This patch addressed the issue by calling stopDragging() in
135         SliderThumbElement::disabledAttributeChanged() instead. This is much safer as we
136         guarantee will exit dragging mode whenever the range element gets disabled, even
137         if SliderThumbElement::defaultEventHandler() does not get called after that.
138
139         Test: fast/forms/range/disabled-while-dragging.html
140
141         * html/RangeInputType.cpp:
142         (WebCore::RangeInputType::disabledAttributeChanged):
143         * html/RangeInputType.h:
144         * html/shadow/SliderThumbElement.cpp:
145         (WebCore::SliderThumbElement::defaultEventHandler):
146         (WebCore::SliderThumbElement::disabledAttributeChanged):
147         * html/shadow/SliderThumbElement.h:
148
149 2017-04-05  Eric Carlson  <eric.carlson@apple.com>
150
151         [MediaStream] Video doesn't render in fullscreen on iOS
152         https://bugs.webkit.org/show_bug.cgi?id=170404
153
154         Reviewed by Youenn Fablet.
155         
156         No new tests, filed https://bugs.webkit.org/show_bug.cgi?id=170512.
157
158         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
159         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
160         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC): Include
161         video fullscreen manager on iOS too.
162         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::videoTransformationMatrix): Add paramater
163         to force transform recalculation.
164         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample): Restructure code since
165         the display layer resize happens elsewhere.
166         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers): Include video fullscreen
167         manager on iOS too.
168         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayers): Ditto.
169         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::platformLayer): Ditto.
170         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVideoFullscreenLayer): Ditto.
171         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::backgroundLayerBoundsChanged): Change the
172         display layer size and position immediately instead of waiting for the next sample buffer
173         so the display is correct when fullscreen mode changes when paused.
174
175 2017-04-05  Youenn Fablet  <youenn@apple.com>
176
177         Deprecate and remove URL.createObjectURL(mediastream)
178         https://bugs.webkit.org/show_bug.cgi?id=167518
179         <rdar://problem/31149607>
180
181         Reviewed by Eric Carlson.
182
183         Covered by updated tests.
184
185         * CMakeLists.txt:
186         * DerivedSources.cpp:
187         * DerivedSources.make:
188         * Modules/mediastream/DOMURLMediaStream.cpp: Removed.
189         * Modules/mediastream/DOMURLMediaStream.h: Removed.
190         * Modules/mediastream/DOMURLMediaStream.idl: Removed.
191         * WebCore.xcodeproj/project.pbxproj:
192         * html/DOMURL.idl:
193
194 2017-04-05  Alejandro G. Castro  <alex@igalia.com>
195
196         [Webrtc] Mock realtime sources factories should be static after r213941
197         https://bugs.webkit.org/show_bug.cgi?id=170282
198
199         Reviewed by Alex Christensen.
200
201         If we don't make the variables static we would be returning a
202         local variable.
203
204         * platform/mock/MockRealtimeAudioSource.cpp:
205         (WebCore::MockRealtimeAudioSource::factory):
206         * platform/mock/MockRealtimeVideoSource.cpp:
207         (WebCore::MockRealtimeVideoSource::factory):
208
209 2017-04-05  Alex Christensen  <achristensen@webkit.org>
210
211         Fix CMake build.
212
213         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
214         Some JavaScript inline functions were not being accessed from this file with different enable flags.
215         * platform/spi/cf/CFNetworkSPI.h:
216         * platform/spi/cocoa/NSURLConnectionSPI.h:
217         Moved NSURLSession-specific SPI from NSURLConnectionSPI.h to CFNetworkSPI.h.
218
219 2017-04-05  Chris Dumez  <cdumez@apple.com>
220
221         _blank / _self / _parent / _top browsing context names should be case-insensitive
222         https://bugs.webkit.org/show_bug.cgi?id=169747
223
224         Reviewed by Alex Christensen.
225
226         _blank / _self / _parent / _top browsing context names should be case-insensitive
227         as per the HTML specification:
228         - https://html.spec.whatwg.org/#browsing-context-names
229
230         This aligns our behavior with Firefox as well. See discussion at:
231         - https://github.com/whatwg/html/issues/2443
232
233         Tests: imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-_blank.html
234                imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-001.html
235                imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-002.html
236                imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-003.html
237                imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-004.html
238
239         * loader/FrameLoader.cpp:
240         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
241         (WebCore::createWindow):
242         * page/DOMWindow.cpp:
243         (WebCore::DOMWindow::open):
244         * page/FrameTree.cpp:
245         (WebCore::FrameTree::uniqueChildName):
246         (WebCore::FrameTree::find):
247
248 2017-04-05  Miguel Gomez  <magomez@igalia.com>
249
250         [GTK+] PNG animations that should run once are not played at all
251         https://bugs.webkit.org/show_bug.cgi?id=170499
252
253         Reviewed by Carlos Garcia Campos.
254
255         The repetition count reported bu the PNGImageDecoder is wrong. It's returning m_playCount - 1, which
256         means 0 for the animations that need to be played once. Change it to return an appropriate value.
257
258         Covered by existent tests.
259
260         * platform/image-decoders/png/PNGImageDecoder.cpp:
261         (WebCore::PNGImageDecoder::repetitionCount):
262         * platform/image-decoders/png/PNGImageDecoder.h:
263
264 2017-04-05  Andy Estes  <aestes@apple.com>
265
266         REGRESSION (r202472): Data Detection overwrites existing links in detected ranges
267         https://bugs.webkit.org/show_bug.cgi?id=170365
268         <rdar://problem/29205721>
269
270         Reviewed by Tim Horton.
271
272         r202472 changed the node traversal in searchForLinkRemovingExistingDDLinks() to only
273         consider nodes that are descendants of startNode, but we need to traverse all nodes between
274         startNode and endNode to find existing non-DD links.
275
276         As a result, we'd add a Data Detector link to the following snippet and make the original
277         links un-clickable:
278
279             <a href='#'>tomorrow</a> <a href='#'>night</a>
280
281         Fix this by not specifying a stayWithin node when calling NodeTraversal::next(). The loop
282         will terminate when we reach endNode.
283
284         Updated WebKit2.DataDetectionReferenceDate API test.
285
286         * editing/cocoa/DataDetection.mm:
287         (WebCore::searchForLinkRemovingExistingDDLinks):
288
289 2017-04-04  Carlos Garcia Campos  <cgarcia@igalia.com>
290
291         Move WebErrors from WebProcess to Shared and get rid of ErrorsGtk in WebCore
292         https://bugs.webkit.org/show_bug.cgi?id=156974
293
294         Reviewed by Sam Weinig.
295
296         Remove ErrorsGtk.
297
298         * PlatformGTK.cmake:
299         * platform/gtk/ErrorsGtk.cpp: Removed.
300         * platform/gtk/ErrorsGtk.h: Removed.
301
302 2017-04-05  Andy Estes  <aestes@apple.com>
303
304         [ios-simulator] API test WebKit2.DataDetectionReferenceDate timing out
305         https://bugs.webkit.org/show_bug.cgi?id=161967
306
307         Reviewed by Alexey Proskuryakov.
308
309         DataDetectorsCoreSPI.h defined DDQueryOffset as a struct of two CFIndexes, which is 16 bytes
310         on LP64, but the struct is actually defined as two CFIndex-typed 32-bit bitfields, which is
311         8 bytes on LP64. This breaks the ABI on Public SDK builds when calling functions that take
312         or return DDQueryOffsets.
313
314         * platform/spi/cocoa/DataDetectorsCoreSPI.h: Updated the DDQueryOffset definition for
315         Public SDK builds, and added a static_assert to detect future size changes at compile time.
316
317 2017-04-04  Jer Noble  <jer.noble@apple.com>
318
319         Move AVSampleBufferDisplayLayer declarations into AVFoundationSPI.h
320         https://bugs.webkit.org/show_bug.cgi?id=170471
321
322         Reviewed by Eric Carlson.
323
324         Move the declaration of AVSampleBufferDisplayLayer (and related classes) into AVFoundationSPI.
325
326         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
327         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
328         * platform/spi/mac/AVFoundationSPI.h:
329
330 2017-04-04  Youenn Fablet  <youenn@apple.com>
331
332         Canvas is tainted when painting a video with MediaStreamTrack
333         https://bugs.webkit.org/show_bug.cgi?id=170486
334
335         Reviewed by Eric Carlson.
336
337         Test: http/tests/media/media-stream/getusermedia-with-canvas.html
338
339         Adding the notion of isolated source so that we can later on implement WebRTC isolated tracks.
340         For now, canvas will not be tainted if painted from a MediaStreamTrack.
341
342         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
343         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
344         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::didPassCORSAccessCheck):
345         * platform/mediastream/MediaStreamTrackPrivate.h:
346         (WebCore::MediaStreamTrackPrivate::isIsolated):
347         * platform/mediastream/RealtimeMediaSource.h:
348
349 2017-04-04  Commit Queue  <commit-queue@webkit.org>
350
351         Unreviewed, rolling out r214894, r214895, r214907, r214912,
352         and r214918.
353         https://bugs.webkit.org/show_bug.cgi?id=170491
354
355         Caused build failures on Mac (Requested by rniwa on #webkit).
356
357         Reverted changesets:
358
359         "Build fix."
360         http://trac.webkit.org/changeset/214894
361
362         "Rolling back the build fix, as it broke other builds."
363         http://trac.webkit.org/changeset/214895
364
365         "Move AVSampleBufferDisplayLayer declarations into
366         AVFoundationSPI.h"
367         https://bugs.webkit.org/show_bug.cgi?id=170471
368         http://trac.webkit.org/changeset/214907
369
370         "Unreviewed build fix: fix compilation error on Sierra."
371         http://trac.webkit.org/changeset/214912
372
373         "More build fixing."
374         http://trac.webkit.org/changeset/214918
375
376 2017-04-04  Youenn Fablet  <youenn@apple.com>
377
378         [Mac] Add back web audio support for getUserMedia MediaStreamTrack
379         https://bugs.webkit.org/show_bug.cgi?id=170482
380
381         Reviewed by Eric Carlson.
382
383         ´Covered by reenabled test.
384
385         Exporting method and class used in WebKit2.
386
387         * WebCore.xcodeproj/project.pbxproj:
388         * platform/audio/mac/CAAudioStreamDescription.h:
389         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h:
390
391 2017-04-04  Alexey Proskuryakov  <ap@apple.com>
392
393         More build fixing.
394
395         * platform/spi/mac/AVFoundationSPI.h:
396
397 2017-04-04  Simon Fraser  <simon.fraser@apple.com>
398
399         Do some minor FEColorMatrix code cleanup and optimization
400         https://bugs.webkit.org/show_bug.cgi?id=170474
401
402         Reviewed by Dean Jackson.
403
404         Don't switch inside of a pixel processing loop; repeat the loop inside switch (filterType).
405         
406         Change matrix() and saturateAndHueRotate() to dereference the source pixels once, instead
407         of multiple times, which is faster.
408         
409         This kind of code benefits from aligning things with spaces for readability, so do so,
410         violating webkit style.
411         
412         Add some off-by-default performance logging code.
413
414         Increases pixel processing performance from about 86ms per megapixel to 65ms per megapixel.
415
416         * platform/graphics/filters/FEColorMatrix.cpp:
417         (WebCore::matrix):
418         (WebCore::saturateAndHueRotate):
419         (WebCore::effectType):
420         (WebCore::FEColorMatrix::platformApplySoftware):
421
422 2017-04-04  Brent Fulgham  <bfulgham@apple.com>
423
424         Do not assert when CharacterData representing an Attr fires events
425         https://bugs.webkit.org/show_bug.cgi?id=170454
426         <rdar://problem/30979320>
427
428         Reviewed by Ryosuke Niwa.
429
430         Make the NoEventDispatchAssertion in CharacterData::notifyParentAfterChange conditional
431         since Attr elements should be allowed to fire events.
432
433         Tests: fast/dom/no-assert-for-malformed-js-url-attribute.html
434
435         * dom/CharacterData.cpp:
436         (WebCore::CharacterData::notifyParentAfterChange):
437
438 2017-04-04  Youenn Fablet  <youenn@apple.com>
439
440         LayoutTest webrtc/libwebrtc/descriptionGetters.html is a flaky failure
441         https://bugs.webkit.org/show_bug.cgi?id=169481
442
443         Reviewed by Eric Carlson.
444
445         No need to enumerate all network interfaces in most layout tests.
446         Adding an Internals API for that in case we want to use TCP localhost candidates.
447
448         * testing/Internals.cpp:
449         (WebCore::Internals::Internals):
450         (WebCore::Internals::setEnumeratingAllNetworkInterfacesEnabled):
451         * testing/Internals.h:
452         * testing/Internals.idl:
453
454
455 2017-04-04  Jer Noble  <jer.noble@apple.com>
456
457         Unreviewed build fix: fix compilation error on Sierra.
458
459         * platform/spi/mac/AVFoundationSPI.h:
460
461 2017-04-04  Jer Noble  <jer.noble@apple.com>
462
463         Move AVSampleBufferDisplayLayer declarations into AVFoundationSPI.h
464         https://bugs.webkit.org/show_bug.cgi?id=170471
465
466         Reviewed by Eric Carlson.
467
468         Move the declaration of AVSampleBufferDisplayLayer (and related classes) into AVFoundationSPI.
469
470         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
471         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addDisplayLayer): Deleted.
472         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeDisplayLayer): Deleted.
473         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
474         * platform/spi/mac/AVFoundationSPI.h:
475
476 2017-04-04  Saam Barati  <sbarati@apple.com>
477
478         WebAssembly: JSWebAssemblyCallee should not be a JSCell
479         https://bugs.webkit.org/show_bug.cgi?id=170135
480
481         Reviewed by Michael Saboff.
482
483         * bindings/js/JSDOMWindowBase.cpp:
484         (WebCore::callerDOMWindow):
485
486 2017-04-04  Simon Fraser  <simon.fraser@apple.com>
487
488         Change Document's lastHandledUserGestureTimestamp to be a MonotonicTime
489         https://bugs.webkit.org/show_bug.cgi?id=170468
490
491         Reviewed by Zalan Bujtas.
492         
493         Change the double to MonotonicTime. No behavior change.
494
495         * dom/Document.cpp:
496         (WebCore::Document::updateLastHandledUserGestureTimestamp):
497         * dom/Document.h:
498         (WebCore::Document::lastHandledUserGestureTimestamp):
499         * html/HTMLPlugInImageElement.cpp:
500         (WebCore::documentHadRecentUserGesture):
501         * loader/FrameLoader.cpp:
502         (WebCore::shouldAskForNavigationConfirmation):
503
504 2017-04-04  Youenn Fablet  <youenn@apple.com>
505
506         [Debug] ASSERT(!throwScope.exception()) on imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status-worker.html
507         https://bugs.webkit.org/show_bug.cgi?id=170395
508         <rdar://problem/31394017>
509
510         Reviewed by Mark Lam.
511
512         No change of behavior.
513
514         * bindings/js/JSDOMPromise.cpp:
515         (WebCore::DeferredPromise::reject): Adding early ASSERT that creating an exception is happening correctly.
516
517 2017-04-04  Alexey Proskuryakov  <ap@apple.com>
518
519         Rolling back the build fix, as it broke other builds.
520
521         * platform/spi/mac/AVFoundationSPI.h:
522
523 2017-04-04  Alexey Proskuryakov  <ap@apple.com>
524
525         Build fix.
526
527         Rubber-stamped by Jer Noble.
528
529         * platform/spi/mac/AVFoundationSPI.h:
530
531 2017-04-04  Tim Horton  <timothy_horton@apple.com>
532
533         [Mac] -[WKWebView findMatchesForString:relativeToMatch:findOptions:maxResults:resultCollector:] invokes the resultCollector with didWrap = NO even when it wraps
534         https://bugs.webkit.org/show_bug.cgi?id=165801
535         <rdar://problem/29649535>
536
537         Reviewed by Wenson Hsieh.
538
539         New API tests: WebKit2.FindInPageWrapping*
540
541         * page/FrameTree.cpp:
542         (WebCore::FrameTree::traverseNextWithWrap):
543         (WebCore::FrameTree::traversePreviousWithWrap):
544         (WebCore::FrameTree::traverseNextInPostOrderWithWrap):
545         * page/FrameTree.h:
546         Add CanWrap and DidWrap boolean enums, and add an optional out argument
547         to traverse*WithWrap indicating whether a wrap actually occurred.
548
549         * history/CachedPage.cpp:
550         (WebCore::firePageShowAndPopStateEvents):
551         * history/PageCache.cpp:
552         (WebCore::destroyRenderTree):
553         Adjust to the new CanWrap enum.
554         
555         * page/Page.cpp:
556         (WebCore::incrementFrame):
557         (WebCore::Page::findString):
558         (WebCore::Page::findStringMatchingRanges):
559         (WebCore::Page::rangeOfString):
560         (WebCore::Page::findMatchesForText):
561         (WebCore::Page::unmarkAllTextMatches):
562         * page/Page.h:
563         Adjust to the new CanWrap enum, and optionally plumb DidWrap through
564         to callers of findString().
565
566 2017-04-04  Carlos Garcia Campos  <cgarcia@igalia.com>
567
568         [GTK] PLATFORM(GTK) && !USE(COORDINATED_GRAPHICS_THREADED) is no longer possible
569         https://bugs.webkit.org/show_bug.cgi?id=170458
570
571         Reviewed by Carlos Alberto Lopez Perez.
572
573         That is not supported anymore, so we can remove dead code from VideoSinkGStreamer.cpp
574
575         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
576         (VideoRenderRequestScheduler::VideoRenderRequestScheduler):
577
578 2017-04-04  Per Arne Vollan  <pvollan@apple.com>
579
580         Unreviewed Windows build fix.
581
582         * bindings/js/JSDOMGuardedObject.h:
583
584 2017-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>
585
586         Data interaction should register type identifiers in order of priority
587         https://bugs.webkit.org/show_bug.cgi?id=170428
588         <rdar://problem/30633296>
589
590         Reviewed by Tim Horton.
591
592         Currently, due to the shared logic for writing to a UIPasteboard (in the case of copy/paste) and the shared
593         UIItemProvider-based pasteboard wrapper (in the case of data interaction), we don't enforce any particular
594         ordering in which type identifiers are registered in the generated item provider. This is because
595         -[UIPasteboard setItems:] only takes an unordered mapping of type identifiers to objects.
596
597         To fix this, we introduce a separate way to set pasteboard data that first writes a list of object
598         representations in order of priority (which is dependent on the content being interacted with) and then register
599         individual type-data mappings at the end.
600
601         Augmented existing API tests in DataInteractionTests to check for the existence and priority of type identifiers
602         in the UIItemProviders created upon starting data interaction. Also adds a new unit test:
603         DataInteractionTests.TextAreaToInput.
604
605         * WebCore.xcodeproj/project.pbxproj:
606         * editing/cocoa/EditorCocoa.mm:
607         (WebCore::archivedDataForAttributedString):
608         (WebCore::Editor::writeSelectionToPasteboard):
609         (WebCore::Editor::writeSelection):
610         * platform/Pasteboard.h:
611         * platform/PasteboardWriterData.h:
612         * platform/PlatformPasteboard.h:
613         * platform/ios/AbstractPasteboard.h:
614         * platform/ios/AbstractPasteboard.mm: Copied from Source/WebCore/platform/ios/AbstractPasteboard.h.
615
616         Introduce WebPasteboardItemData, a wrapper around a list of objects representating the pasteboard data in order
617         of priority, and a dictionary containing additional NSData blobs that contain data useful for private clients.
618
619         (+[WebPasteboardItemData itemWithRepresentingObjects:additionalData:]):
620         (-[WebPasteboardItemData initWithRepresentingObjects:additionalData:]):
621         (-[WebPasteboardItemData representingObjects]):
622         (-[WebPasteboardItemData additionalData]):
623         * platform/ios/PlatformPasteboardIOS.mm:
624         (WebCore::richTextRepresentationsForPasteboardWebContent):
625         (WebCore::PlatformPasteboard::writeObjectRepresentations):
626         (WebCore::PlatformPasteboard::write):
627
628         Tweaked to check whether the pasteboard responds to -setItemsFromObjectRepresentations:. If so, uses the
629         PlatformPasteboard::writeObjectRepresentations codepath to write data to the pasteboard, respecting type
630         priority.
631
632         * platform/ios/WebItemProviderPasteboard.mm:
633         (-[WebItemProviderPasteboard pasteboardTypes]):
634         (-[WebItemProviderPasteboard setItemProviders:]):
635         (-[WebItemProviderPasteboard setItemsFromObjectRepresentations:]):
636
637         Replaces -setItems: with -setItemsFromObjectRepresentations:, which respects the priority of each object
638         representation of the data in the pasteboard.
639
640         (-[WebItemProviderPasteboard setItems:]): Deleted.
641
642 2017-04-03  Javier Fernandez  <jfernandez@igalia.com>
643
644         [css-align] Adapt place-content alignment shorthand to the new baseline syntax
645         https://bugs.webkit.org/show_bug.cgi?id=170340
646
647         Reviewed by David Hyatt.
648
649         Now that the align-content and justify-content CSS properties are
650         adapted to the new baseline-position CSS values syntax we can adapt the
651         shorthand that controls such properties to the new syntax as well.
652
653         No new tests, just adding some additional cases to the tests we already have.
654
655         * css/StyleProperties.cpp:
656         (WebCore::StyleProperties::getPropertyValue):
657         (WebCore::StyleProperties::placeContentPropertyValue):
658         * css/StyleProperties.h:
659         * css/parser/CSSPropertyParser.cpp:
660         (WebCore::isContentDistributionKeyword):
661         (WebCore::isContentPositionKeyword):
662         (WebCore::isOverflowKeyword):
663         (WebCore::getBaselineKeyword):
664         (WebCore::consumeContentDistributionOverflowPosition):
665         (WebCore::consumeSimplifiedContentPosition):
666
667 2017-04-03  Nan Wang  <n_wang@apple.com>
668
669         AX: Expose link children when doing search predication on iOS
670         https://bugs.webkit.org/show_bug.cgi?id=170424
671         <rdar://problem/31413335>
672
673         The children of links are accessible elements on iOS instead of the link itself, 
674         so we should expose the children when doing predicated searches as well.
675
676         Reviewed by Chris Fleizach.
677
678         Test: accessibility/ios-simulator/ios-search-predicate-link-children.html
679
680         * accessibility/AccessibilityObject.cpp:
681         (WebCore::AccessibilityObject::isAccessibilityObjectSearchMatchAtIndex):
682
683 2017-04-03  Jer Noble  <jer.noble@apple.com>
684
685         No audio output for MediaStream-backed audio elements on iOS
686         https://bugs.webkit.org/show_bug.cgi?id=170427
687
688         Reviewed by Eric Carlson.
689
690         The logic for setting the output timestamp offset in AudioSampleDataSource was reversed; instead of
691         subtracting out the timestamp of the first pull request, it effectively doubled it.
692
693         * platform/audio/mac/AudioSampleDataSource.mm:
694         (WebCore::AudioSampleDataSource::pullSamplesInternal):
695
696 2017-04-03  Dave Hyatt  <hyatt@apple.com>
697
698         Japanese fonts in vertical text should support synthesized italics
699         https://bugs.webkit.org/show_bug.cgi?id=169301
700
701         Reviewed by Simon Fraser.
702
703         Updated test in fast/text/international.
704
705         * platform/graphics/Font.cpp:
706         (WebCore::Font::nonSyntheticItalicFont): Deleted.
707         * platform/graphics/Font.h:
708         Removed the non-synthetic italic font member, since it's not used.
709
710         * platform/graphics/FontCascadeFonts.cpp:
711         (WebCore::glyphDataForNonCJKCharacterWithGlyphOrientation):
712         Patched to ensure that a text-orientation-fallback font data is always
713         returned in the synthetic oblique case, so that non-CJK and CJK are
714         guaranteed to be broken up so that their slants can be applied differently.
715
716         (WebCore::FontCascadeFonts::glyphDataForSystemFallback):
717         (WebCore::FontCascadeFonts::glyphDataForNormalVariant):
718         (WebCore::glyphDataForCJKCharacterWithoutSyntheticItalic): Deleted.
719         Patched to no longer turn off synthetic oblique for CJK.
720
721         * platform/graphics/cocoa/FontCascadeCocoa.mm:
722         (WebCore::FontCascade::drawGlyphs):
723         Apply the correct italic transform to CJK when in vertical text.
724
725 2017-04-03  Chris Dumez  <cdumez@apple.com>
726
727         REGRESSION (r206744): CSS background-image in style attribute ignored when using createHTMLDocument method of DOM parsing
728         https://bugs.webkit.org/show_bug.cgi?id=170285
729         <rdar://problem/31378543>
730
731         Reviewed by Andy Estes.
732
733         r206744 caused up to stop trying to resolve relative URLs when trying to load an image
734         referred to by CSS. We already try to resolve the relative URL when parsing the CSS
735         property so this will usually work fine. However, in the case when the CSS property
736         is parsed in detached document and then moved to another document, we will not have
737         the complete URL.
738
739         Test: fast/images/background-image-relative-url-changes-document.html
740
741         * css/CSSImageValue.cpp:
742         (WebCore::CSSImageValue::loadImage):
743
744 2017-04-03  Jeremy Jones  <jeremyj@apple.com>
745
746         Do not set WebAVPlayerLayerView background to black in fullscreen.
747         https://bugs.webkit.org/show_bug.cgi?id=170132
748         rdar://problem/30839278
749
750         Reviewed by Tim Horton.
751
752         No new tests because no behavior change.
753
754         The black background on WebAVPlayerLayerView interferes with the fullscreen animation
755         and has been removed.
756
757         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
758         (WebVideoFullscreenInterfaceAVKit::enterFullscreen):
759         (WebVideoFullscreenInterfaceAVKit::enterFullscreenStandard):
760
761 2017-04-03  Antti Koivisto  <antti@apple.com>
762
763         REGRESSION (r207669): FileMaker Pro Help pages do not render correctly
764         https://bugs.webkit.org/show_bug.cgi?id=170402
765         <rdar://problem/31004344>
766
767         Reviewed by Simon Fraser.
768
769         If a new stylesheet load is started from the load event the document.styleSheets does not
770         always reflect the already loaded stylesheets.
771
772         Test: fast/css/document-stylesheets-dynamic.html
773
774         * style/StyleScope.cpp:
775         (WebCore::Style::Scope::updateActiveStyleSheets):
776
777             Remove an old optimization where we would not update active stylesheets if there were pending
778             (head) stylesheet loads and they had not been updated already.
779             This is probably not a valuable optimization anymore with the new lazy stylesheet update strategy.
780
781         * style/StyleScope.h:
782
783 2017-04-03  Anders Carlsson  <andersca@apple.com>
784
785         Tweak ApplePaySession API
786         https://bugs.webkit.org/show_bug.cgi?id=170409
787         rdar://problem/31405459
788
789         Reviewed by Tim Horton.
790
791         Rename "address" to "addressLines". Add "postalAddress". Reorder the ApplePayError constructor parameters.
792
793         * Modules/applepay/ApplePayError.cpp:
794         (WebCore::ApplePayError::create):
795         (WebCore::ApplePayError::ApplePayError):
796         * Modules/applepay/ApplePayError.h:
797         * Modules/applepay/ApplePayError.idl:
798         * Modules/applepay/PaymentRequest.h:
799
800 2017-04-03  Zan Dobersek  <zdobersek@igalia.com>
801
802         [GCrypt] Implement CryptoKeyEC::keySizeInBits(), ::platformGeneratePair()
803         https://bugs.webkit.org/show_bug.cgi?id=170345
804
805         Reviewed by Michael Catanzaro.
806
807         Start implementing the libgcrypt-based platform bits of CryptoKeyEC.
808
809         Implement keySizeInBits() by returning the appropriate size for this
810         object's curve type. An assertion is added to ensure that this size
811         matches the one that's returned by gcry_pk_get_nbits() for this
812         object's EC key as represented by the m_platformKey gcry_sexp_t object.
813
814         Implement platformGeneratePair() by constructing a genkey s-expression
815         that requests a generation of an EC key for the specified curve type.
816         The s-expression is then passed to gcry_pk_genkey(), and the public
817         and private key data is then retrieved from the returned s-expression
818         upon success and used to create the public and private CryptoKeyEC
819         objects.
820
821         The PlatformECKey type alias is changed to match gcry_sexp_t. The
822         CryptoKeyEC destructor releases the gcry_sexp_t object through
823         a PAL::GCrypt::HandleDeleter<gcry_sexp_t> instance.
824
825         The method definitions in the CryptoKeyECGCrypt.cpp file are also
826         sorted to match the declaration order in the header.
827
828         No new tests -- current ones cover this sufficiently, but are not yet
829         enabled due to other missing platform-specific SUBTLE_CRYPTO
830         implementations.
831
832         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
833         (WebCore::curveSize):
834         (WebCore::curveName):
835         (WebCore::CryptoKeyEC::~CryptoKeyEC):
836         (WebCore::CryptoKeyEC::keySizeInBits):
837         (WebCore::CryptoKeyEC::platformGeneratePair):
838         (WebCore::CryptoKeyEC::platformImportSpki):
839         (WebCore::CryptoKeyEC::platformImportPkcs8):
840         (WebCore::CryptoKeyEC::platformExportRaw):
841         (WebCore::CryptoKeyEC::platformAddFieldElements):
842         (WebCore::CryptoKeyEC::platformExportSpki):
843         * crypto/keys/CryptoKeyEC.h:
844
845 2017-04-03  Zan Dobersek  <zdobersek@igalia.com>
846
847         [GCrypt] Implement AES_KW support
848         https://bugs.webkit.org/show_bug.cgi?id=170274
849
850         Reviewed by Michael Catanzaro.
851
852         Implement the CryptoAlgorithmAES_KW::platform{Wrap,Unwrap}Key()
853         functionality for configurations that use libgcrypt. This is done
854         by leveraging the gcry_cipher_* APIs for the AES algorithm that's
855         deducted appropriately from the key size and the AESWRAP cipher mode.
856
857         No new tests -- current ones cover this sufficiently, but are not yet
858         enabled due to other missing platform-specific SUBTLE_CRYPTO
859         implementations.
860
861         * crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp:
862         (WebCore::gcryptWrapKey):
863         (WebCore::gcryptUnwrapKey):
864         (WebCore::CryptoAlgorithmAES_KW::platformWrapKey):
865         (WebCore::CryptoAlgorithmAES_KW::platformUnwrapKey):
866
867 2017-04-03  Zan Dobersek  <zdobersek@igalia.com>
868
869         [GCrypt] Implement AES_GCM support
870         https://bugs.webkit.org/show_bug.cgi?id=170271
871
872         Reviewed by Michael Catanzaro.
873
874         Implement the CryptoAlgorithmAES_GCM::platform{Encrypt,Decrypt}
875         functionality for configurations that use libgcrypt. This is done
876         by leveraging the gcry_cipher_* APIs for the AES algorithm that's
877         deducted appropriately from the key size and the GCM cipher mode.
878
879         No new tests -- current ones cover this sufficiently, but are not yet
880         enabled due to other missing platform-specific SUBTLE_CRYPTO
881         implementations.
882
883         * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp:
884         (WebCore::gcryptEncrypt):
885         (WebCore::gcryptDecrypt):
886         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
887         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
888
889 2017-04-03  Zan Dobersek  <zdobersek@igalia.com>
890
891         [GCrypt] Implement PBKDF2 support
892         https://bugs.webkit.org/show_bug.cgi?id=170270
893
894         Reviewed by Michael Catanzaro.
895
896         Implement the CryptoAlgorithmPBKDF2::platformDeriveBits() functionality
897         for configurations that use libgcrypt. This is done by leveraging the
898         gcry_kdf_derive() API, using GCRY_KDF_PBKDF2 as the preferred KDF
899         along with the properly deducted SHA algorithm.
900
901         No new tests -- current ones cover this sufficiently, but are not yet
902         enabled due to other missing platform-specific SUBTLE_CRYPTO
903         implementations.
904
905         * crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp:
906         (WebCore::gcryptDeriveBits):
907         (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
908
909 2017-04-01  Simon Fraser  <simon.fraser@apple.com>
910
911         Clean up touch event handler registration when moving nodes between documents
912         https://bugs.webkit.org/show_bug.cgi?id=170384
913         rdar://problem/30816694
914
915         Reviewed by Chris Dumez.
916
917         Make sure that Node::didMoveToNewDocument() does the correct unregistration on the
918         old document, and registration on the new document for nodes with touch event listeners,
919         and gesture event listeners. Touch "handler" nodes (those for overflow and sliders) are
920         already correctly moved via renderer-related teardown.
921
922         Add assertions that fire when removal was not complete.
923
924         Use references in more places.
925
926         Tests: fast/events/touch/ios/gesture-node-move-between-documents.html
927                fast/events/touch/ios/overflow-node-move-between-documents.html
928                fast/events/touch/ios/slider-node-move-between-documents.html
929                fast/events/touch/ios/touch-node-move-between-documents.html
930
931         * dom/EventNames.h:
932         (WebCore::EventNames::gestureEventNames):
933         * dom/Node.cpp:
934         (WebCore::Node::willBeDeletedFrom):
935         (WebCore::Node::didMoveToNewDocument):
936         (WebCore::tryAddEventListener):
937         (WebCore::tryRemoveEventListener):
938         * html/shadow/SliderThumbElement.cpp:
939         (WebCore::SliderThumbElement::registerForTouchEvents):
940         (WebCore::SliderThumbElement::unregisterForTouchEvents):
941         * rendering/RenderLayer.cpp:
942         (WebCore::RenderLayer::registerAsTouchEventListenerForScrolling):
943         (WebCore::RenderLayer::unregisterAsTouchEventListenerForScrolling):
944
945 2017-04-03  Youenn Fablet  <youenn@apple.com>
946
947         captureStream is getting black frames with webgl canvas
948         https://bugs.webkit.org/show_bug.cgi?id=170325
949
950         Reviewed by Dean Jackson.
951
952         Test: fast/mediastream/captureStream/canvas3d.html
953
954         Changing the webgl context to save buffers in case the canvas is captured.
955         Adding a canvas changed notification in case of clear.
956         In the future, we might want to change this notification and do it when endPaint or similar is called.
957
958         Adding an Internals API to grab the RGBA equivalent of the next track frame.
959         For that purpose, adding a bunch of WEBCORE_EXPORT.
960
961         * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
962         (WebCore::CanvasCaptureMediaStreamTrack::Source::Source): Adding constraints support so that track settings
963         getter actually transmits the width and height of the source.
964         (WebCore::CanvasCaptureMediaStreamTrack::Source::canvasChanged): ensuring webgl canvas context keep their drawing buffer.
965         * Modules/mediastream/MediaStreamTrack.h:
966         * bindings/js/JSDOMGuardedObject.h:
967         * bindings/js/JSDOMPromise.h:
968         (WebCore::DeferredPromise::resolve):
969         (WebCore::DeferredPromise::reject):
970         * dom/ActiveDOMCallback.h:
971         * html/HTMLCanvasElement.cpp:
972         (WebCore::HTMLCanvasElement::captureStream):
973         * html/ImageData.h:
974         * html/ImageData.idl:
975         * html/canvas/WebGLRenderingContext.cpp:
976         (WebCore::WebGLRenderingContext::clear): ensuring canvas observers get notified in case of clear calls.
977         * html/canvas/WebGLRenderingContextBase.h:
978         (WebCore::WebGLRenderingContextBase::preserveDrawingBuffer): Added to allow canvas capture to update this property.
979         * platform/MediaSample.h:
980         (WebCore::MediaSample::getRGBAImageData): Added for internals API.
981         * platform/graphics/avfoundation/MediaSampleAVFObjC.h:
982         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
983         (WebCore::MediaSampleAVFObjC::getRGBAImageData):
984         * platform/graphics/cv/PixelBufferConformerCV.cpp:
985         (WebCore::PixelBufferConformerCV::convert): Helper routine for getRGBAImageData.
986         * platform/graphics/cv/PixelBufferConformerCV.h:
987         * platform/mediastream/RealtimeMediaSourceSettings.h:
988         (WebCore::RealtimeMediaSourceSettings::setSupportedConstraints):
989         (WebCore::RealtimeMediaSourceSettings::setSupportedConstraits): Deleted.
990         * platform/mediastream/mac/AVMediaCaptureSource.mm:
991         (WebCore::AVMediaCaptureSource::initializeSettings):
992         * platform/mediastream/openwebrtc/RealtimeAudioSourceOwr.h:
993         * platform/mediastream/openwebrtc/RealtimeVideoSourceOwr.h:
994         * platform/mock/MockRealtimeMediaSource.cpp:
995         (WebCore::MockRealtimeMediaSource::initializeSettings):
996         * testing/Internals.cpp:
997         (WebCore::Internals::grabNextMediaStreamTrackFrame):
998         (WebCore::Internals::videoSampleAvailable):
999         * testing/Internals.h:
1000         * testing/Internals.idl:
1001
1002 2017-04-03  Per Arne Vollan  <pvollan@apple.com>
1003
1004         Implement stroke-miterlimit.
1005         https://bugs.webkit.org/show_bug.cgi?id=169078
1006
1007         Reviewed by Dean Jackson.
1008
1009         Support stroke-miterlimit for text rendering, see https://drafts.fxtf.org/paint/.
1010
1011         Tests: fast/css/stroke-miterlimit-default.html
1012                fast/css/stroke-miterlimit-large.html
1013                fast/css/stroke-miterlimit-zero.html
1014
1015         * css/CSSComputedStyleDeclaration.cpp:
1016         (WebCore::ComputedStyleExtractor::propertyValue):
1017         * css/CSSProperties.json:
1018         * css/SVGCSSComputedStyleDeclaration.cpp:
1019         (WebCore::ComputedStyleExtractor::svgPropertyValue):
1020         * rendering/TextPaintStyle.cpp:
1021         (WebCore::computeTextPaintStyle):
1022         (WebCore::updateGraphicsContext):
1023         * rendering/TextPaintStyle.h:
1024         * rendering/style/RenderStyle.cpp:
1025         (WebCore::RenderStyle::diff):
1026         * rendering/style/RenderStyle.h:
1027         (WebCore::RenderStyle::strokeMiterLimit):
1028         (WebCore::RenderStyle::setStrokeMiterLimit):
1029         (WebCore::RenderStyle::initialStrokeMiterLimit):
1030         (WebCore::RenderStyle::setStrokeDashOffset):
1031         * rendering/style/RenderStyleConstants.cpp:
1032         * rendering/style/RenderStyleConstants.h:
1033         * rendering/style/SVGRenderStyle.cpp:
1034         (WebCore::SVGRenderStyle::diff):
1035         * rendering/style/SVGRenderStyle.h:
1036         (WebCore::SVGRenderStyle::initialStrokeDashArray):
1037         (WebCore::SVGRenderStyle::strokeDashArray):
1038         (WebCore::SVGRenderStyle::initialStrokeMiterLimit): Deleted.
1039         (WebCore::SVGRenderStyle::strokeMiterLimit): Deleted.
1040         (WebCore::SVGRenderStyle::setStrokeMiterLimit): Deleted.
1041         * rendering/style/SVGRenderStyleDefs.cpp:
1042         (WebCore::StyleStrokeData::StyleStrokeData):
1043         (WebCore::StyleStrokeData::operator==):
1044         * rendering/style/SVGRenderStyleDefs.h:
1045         * rendering/style/StyleRareInheritedData.cpp:
1046         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
1047         (WebCore::StyleRareInheritedData::operator==):
1048         * rendering/style/StyleRareInheritedData.h:
1049         * rendering/svg/RenderSVGShape.cpp:
1050         (WebCore::RenderSVGShape::hasSmoothStroke):
1051         * rendering/svg/SVGRenderSupport.cpp:
1052         (WebCore::SVGRenderSupport::applyStrokeStyleToContext):
1053         * rendering/svg/SVGRenderTreeAsText.cpp:
1054         (WebCore::writeStyle):
1055
1056 2017-04-03  Alejandro G. Castro  <alex@igalia.com>
1057
1058         [OWR] Fix class structure for the OWR mock classes after last modifications
1059         https://bugs.webkit.org/show_bug.cgi?id=170173
1060
1061         Reviewed by Youenn Fablet.
1062
1063         In case of OWR MockRealtimeMediaSource inherits from
1064         RealtimeMediaSourceOwr, so we have to change some of the function
1065         interfaces.
1066
1067         * platform/mock/MockRealtimeMediaSource.h:
1068
1069 2017-04-02  Alexey Proskuryakov  <ap@apple.com>
1070
1071         Build fix for
1072         Add missing text styles
1073         https://bugs.webkit.org/show_bug.cgi?id=170295
1074
1075         * rendering/RenderThemeIOS.mm:
1076         (WebCore::RenderThemeIOS::cachedSystemFontDescription):
1077         (WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
1078
1079 2017-04-01  Zalan Bujtas  <zalan@apple.com>
1080
1081         Long Arabic text in ContentEditable with css white-space=pre hangs Safari
1082         https://bugs.webkit.org/show_bug.cgi?id=170245
1083
1084         Reviewed by Myles C. Maxfield.
1085
1086         While searching for mid-word break, we measure the text by codepoints in a loop until the accumulated width > available width.
1087         When we see that the accumulated width for the individual codepoints overflows, we join the codepoints and re-measure them.
1088         These 2 widths could be considerably different for number of reasons (ligatures is a prime example). When we figure that
1089         the run still fits, we go back to the main loop (since we are not supposed to wrap the line here) and take the next codepoint.
1090         However this time we start the measurement from the last whitespace, so we end up remeasuring a potentially long chuck of text
1091         until we hit the wrapping point. This is way too expensive.
1092         This patch changes the logic so that we just go back to measuring individual codepoints until we hit the constrain again.  
1093
1094         Covered by existing tests.
1095
1096         * rendering/line/BreakingContext.h:
1097         (WebCore::BreakingContext::handleText): canUseSimpleFontCodePath() is just to mitigate the potential risk of regression and
1098         complex text is more likely to fall into this category. 
1099
1100 2017-04-01  Jon Lee  <jonlee@apple.com>
1101
1102         Add missing text styles
1103         https://bugs.webkit.org/show_bug.cgi?id=170295
1104         rdar://problem/30219503
1105
1106         Reviewed by Dean Jackson.
1107
1108         Updated existing test to include new text styles.
1109
1110         * css/CSSValueKeywords.in: Add title0 and title4.
1111         * platform/spi/cocoa/CoreTextSPI.h:
1112         * rendering/RenderThemeIOS.mm:
1113         (WebCore::RenderThemeIOS::cachedSystemFontDescription):
1114         (WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
1115
1116 2017-04-01  Dan Bernstein  <mitz@apple.com>
1117
1118         [iOS] <input type=file> label should be specified using plural rules
1119         https://bugs.webkit.org/show_bug.cgi?id=170388
1120
1121         Reviewed by Alexey Proskuryakov.
1122
1123         * English.lproj/Localizable.strings: Updated using update-webkit-localizable-strings.
1124
1125         * English.lproj/Localizable.stringsdict: Added an entry for the new key "%lu photo(s) and
1126           %lu video(s)", with plural rules covering all the different combinations in English.
1127           Other localizations may specify additional combinations as needed.
1128
1129 2017-04-01  Alexey Proskuryakov  <ap@apple.com>
1130
1131         Rolling back <https://trac.webkit.org/r214697>, as it made WebKit2.DataDetectionReferenceDate time out.
1132
1133         Was REGRESSION (r202472): Data Detection overwrites existing links in detected ranges
1134         https://bugs.webkit.org/show_bug.cgi?id=170365
1135
1136         * editing/cocoa/DataDetection.mm:
1137         (WebCore::searchForLinkRemovingExistingDDLinks):
1138
1139 2017-04-01  Chris Dumez  <cdumez@apple.com>
1140
1141         We should pause silent WebAudio rendering in background tabs
1142         https://bugs.webkit.org/show_bug.cgi?id=170299
1143         <rdar://problem/31289132>
1144
1145         Reviewed by Eric Carlson.
1146
1147         We should pause silent WebAudio rendering in background tabs since it uses CPU and is
1148         not observable by the user. Such silent WebAudio rendering seems to be used by
1149         doubleclick ads.
1150
1151         Test: webaudio/silent-audio-interrupted-in-background.html
1152
1153         * Modules/webaudio/AudioContext.cpp:
1154         (WebCore::AudioContext::lazyInitialize):
1155         (WebCore::AudioContext::uninitialize):
1156         Have AudioContext register / unregister itself with the Document to get
1157         visibility change notifications, similarly to what HTMLMediaElement was
1158         already doing.
1159
1160         (WebCore::AudioContext::visibilityStateChanged):
1161         Begin / End session interruption whenever the page visiblity changes.
1162
1163         * Modules/webaudio/AudioContext.h:
1164         * WebCore.xcodeproj/project.pbxproj:
1165
1166         * dom/Document.cpp:
1167         (WebCore::Document::registerForVisibilityStateChangedCallbacks):
1168         (WebCore::Document::unregisterForVisibilityStateChangedCallbacks):
1169         (WebCore::Document::visibilityStateChanged):
1170         * dom/Document.h:
1171         * dom/Element.h:
1172         * dom/VisibilityChangeClient.h: Added.
1173         (WebCore::VisibilityChangeClient::~VisibilityChangeClient):
1174         * html/HTMLMediaElement.h:
1175         Introduce a new VisibilityChangeClient interface and have both AudioContext
1176         and HTMLMediaElement subclass it. Previously, the visibilityStateChanged()
1177         function was on Element but this prevented AudioContext from registering
1178         itself since AudioContext is not an Element.
1179
1180 2017-04-01  Dan Bernstein  <mitz@apple.com>
1181
1182         [Cocoa] A couple of UI strings use three periods instead of an ellipsis
1183         https://bugs.webkit.org/show_bug.cgi?id=170386
1184
1185         Reviewed by Tim Horton.
1186
1187         * English.lproj/Localizable.strings: Updated using update-webkit-localizable-strings.
1188
1189         * platform/LocalizedStrings.cpp:
1190         (WebCore::mediaElementLoadingStateText): Changed "Loading..." to "Loading…".
1191
1192         * platform/cocoa/LocalizedStringsCocoa.mm:
1193         (WebCore::contextMenuItemTagStyles): Changed "Styles..." to "Styles…".
1194
1195 2017-04-01  Dan Bernstein  <mitz@apple.com>
1196
1197         Localizable strings files are out of date
1198         https://bugs.webkit.org/show_bug.cgi?id=170383
1199
1200         Reviewed by Tim Horton.
1201
1202         Ran update-webkit-localizable-strings.
1203
1204         * English.lproj/Localizable.strings:
1205
1206 2017-04-01  Dan Bernstein  <mitz@apple.com>
1207
1208         [Xcode] In engineering builds, linker warns about libwebrtc.dylib’s install name being invalid
1209         https://bugs.webkit.org/show_bug.cgi?id=170385
1210
1211         Reviewed by Tim Horton.
1212
1213         * Configurations/DebugRelease.xcconfig: Set WK_RELOCATABLE_FRAMEWORKS to YES like we do
1214           in some other projects’ DebugRelease.xcconfig. Engineering builds are always relocatable.
1215         * Configurations/WebCore.xcconfig: When WebCore is relocatable, tell the linker that it’s
1216           not going to be in the shared cache, even if its install name implies that it might be.
1217
1218 2017-04-01  Alexey Proskuryakov  <ap@apple.com>
1219
1220         Rolling back http://trac.webkit.org/r214663 - memory corruption
1221
1222         * Modules/streams/ReadableByteStreamInternals.js:
1223         (cloneArrayBuffer):
1224         * bindings/js/JSDOMGlobalObject.cpp:
1225         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
1226         * bindings/js/StructuredClone.cpp:
1227         (WebCore::structuredCloneArrayBuffer):
1228         (WebCore::cloneArrayBufferImpl): Deleted.
1229         (WebCore::cloneArrayBuffer): Deleted.
1230         * bindings/js/StructuredClone.h:
1231         * bindings/js/WebCoreBuiltinNames.h:
1232         * testing/Internals.cpp:
1233         (WebCore::markerTypeFrom):
1234         (WebCore::Internals::resetToConsistentState):
1235         (WebCore::Internals::isLoadingFromMemoryCache):
1236         (WebCore::Internals::setImageFrameDecodingDuration):
1237         (WebCore::deferredStyleRulesCountForList):
1238         (WebCore::deferredGroupRulesCountForList):
1239         (WebCore::deferredKeyframesRulesCountForList):
1240         (WebCore::Internals::eventThrottlingBehaviorOverride):
1241         (WebCore::Internals::enableMockSpeechSynthesizer):
1242         (WebCore::Internals::rangeForDictionaryLookupAtLocation):
1243         (WebCore::Internals::nodesFromRect):
1244         (WebCore::Internals::layerIDForElement):
1245         (WebCore::Internals::setElementUsesDisplayListDrawing):
1246         (WebCore::Internals::setElementTracksDisplayListReplay):
1247         (WebCore::Internals::styleRecalcCount):
1248         (WebCore::Internals::compositingUpdateCount):
1249         (WebCore::Internals::setCaptionDisplayMode):
1250         (WebCore::Internals::endMediaSessionInterruption):
1251         (WebCore::Internals::postRemoteControlCommand):
1252         (WebCore::appendOffsets):
1253         (WebCore::Internals::scrollSnapOffsets):
1254         (WebCore::Internals::setShowAllPlugins):
1255         (WebCore::Internals::cloneArrayBuffer): Deleted.
1256         * testing/Internals.h:
1257         * testing/Internals.idl:
1258
1259 2017-03-31  Zalan Bujtas  <zalan@apple.com>
1260
1261         <table>: Including <caption>, <thead> or <tbody> causes clipping across page breaks
1262         https://bugs.webkit.org/show_bug.cgi?id=170348
1263         <rdar://problem/24727151>
1264
1265         Reviewed by David Hyatt.
1266
1267         1. In RenderFlowThread::offsetFromLogicalTopOfFirstRegion() we need to take table section offset into account (they are skipped
1268         during the containing block traversal).
1269         2. Trigger paginated relayout when body is moved vertically due to caption/thead etc.
1270
1271         Test: fast/multicol/table-section-page-break.html
1272
1273         * rendering/RenderFlowThread.cpp:
1274         (WebCore::RenderFlowThread::offsetFromLogicalTopOfFirstRegion):
1275         * rendering/RenderTable.cpp:
1276         (WebCore::RenderTable::layout):
1277
1278 2017-03-31  Simon Fraser  <simon.fraser@apple.com>
1279
1280         Rename DOMWindow's m_touchEventListenerCount to m_touchAndGestureEventListenerCount
1281         https://bugs.webkit.org/show_bug.cgi?id=170371
1282
1283         Reviewed by Tim Horton.
1284
1285         This count tracks touch and gesture event listeners, so name it appropriately.
1286
1287         * page/DOMWindow.cpp:
1288         (WebCore::DOMWindow::addEventListener):
1289         (WebCore::DOMWindow::removeEventListener):
1290         (WebCore::DOMWindow::removeAllEventListeners):
1291         * page/DOMWindow.h:
1292
1293 2017-03-31  Simon Fraser  <simon.fraser@apple.com>
1294
1295         When destroying a Node, assert that it's been removed from all the touch handler maps
1296         https://bugs.webkit.org/show_bug.cgi?id=170363
1297         rdar://problem/31377469
1298
1299         Reviewed by Tim Horton.
1300
1301         Assert that the Node has been removed from the touch handler maps in all documents on destruction.
1302
1303         * dom/Document.h:
1304         (WebCore::Document::hasTouchEventHandlers):
1305         (WebCore::Document::touchEventTargetsContain):
1306         * dom/Node.cpp:
1307         (WebCore::Node::~Node):
1308
1309 2017-03-31  Alexey Proskuryakov  <ap@apple.com>
1310
1311         Rolling back https://trac.webkit.org/r214689, as it caused many crashes.
1312
1313         Was:
1314         Fix memory leak in CreateSessionDescriptionObserver::OnSuccess
1315         https://bugs.webkit.org/show_bug.cgi?id=170357
1316
1317         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1318         (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionSucceeded):
1319
1320 2017-03-31  Youenn Fablet  <youenn@apple.com>
1321
1322         Fix memory leak in RealtimeVideoIncomingSource
1323         https://bugs.webkit.org/show_bug.cgi?id=170356
1324
1325         Reviewed by Eric Carlson.
1326
1327         No change of behavior.
1328
1329         * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
1330         (WebCore::RealtimeIncomingVideoSource::OnFrame): Adopting the newly created pointer.
1331
1332 2017-03-31  Andy Estes  <aestes@apple.com>
1333
1334         REGRESSION (r202472): Data Detection overwrites existing links in detected ranges
1335         https://bugs.webkit.org/show_bug.cgi?id=170365
1336         <rdar://problem/29205721>
1337
1338         Reviewed by Tim Horton.
1339
1340         r202472 changed the node traversal in searchForLinkRemovingExistingDDLinks() to only
1341         consider nodes that are descendants of startNode, but we need to traverse all nodes between
1342         startNode and endNode to find existing non-DD links.
1343
1344         As a result, we'd add a Data Detector link to the following snippet and make the original
1345         links un-clickable:
1346
1347             <a href='#'>tomorrow</a> <a href='#'>night</a>
1348
1349         Fix this by not specifying a stayWithin node when calling NodeTraversal::next(). The loop
1350         will terminate when we reach endNode.
1351
1352         Updated WebKit2.DataDetectionReferenceDate API test.
1353
1354         * editing/cocoa/DataDetection.mm:
1355         (WebCore::searchForLinkRemovingExistingDDLinks):
1356
1357 2017-03-31  Eric Carlson  <eric.carlson@apple.com>
1358
1359         Incoming video source doesn't propogate frame rotation
1360         https://bugs.webkit.org/show_bug.cgi?id=170364
1361
1362         Reviewed by Youenn Fablet.
1363
1364         No new tests, the mock video source doesn't support rotation. Test will be added when
1365         this is fixed in https://bugs.webkit.org/show_bug.cgi?id=169822. The changes were 
1366         verified manually.
1367
1368         * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
1369         (WebCore::RealtimeIncomingVideoSource::OnFrame): Convert frame rotation to sample
1370         orientation and swap width and height when necessary.
1371         (WebCore::RealtimeIncomingVideoSource::processNewSample):
1372         * platform/mediastream/mac/RealtimeIncomingVideoSource.h:
1373
1374 2017-03-31  Chris Dumez  <cdumez@apple.com>
1375
1376         Possible null dereference under SourceBuffer::sourceBufferPrivateDidReceiveSample()
1377         https://bugs.webkit.org/show_bug.cgi?id=159639
1378
1379         Reviewed by Eric Carlson.
1380
1381         Add a null check for trackBuffer.description before dereferencing as it seems
1382         it can be null.
1383
1384         * Modules/mediasource/SourceBuffer.cpp:
1385         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
1386
1387 2017-03-31  Youenn Fablet  <youenn@apple.com>
1388
1389         Fix memory leak in CreateSessionDescriptionObserver::OnSuccess
1390         https://bugs.webkit.org/show_bug.cgi?id=170357
1391
1392         Reviewed by Geoffrey Garen.
1393
1394         No change of behavior.
1395
1396         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1397         (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionSucceeded): Adopting the raw pointer parameter.
1398
1399 2017-03-31  Fujii Hironori  <Hironori.Fujii@sony.com>
1400
1401         [WinCairo] WebCore::PlatformDisplay::terminateEGLDisplay causes a crash in libGLESv2.dll while processing atexit
1402         https://bugs.webkit.org/show_bug.cgi?id=170331
1403
1404         Reviewed by Michael Catanzaro.
1405
1406         WebCore::PlatformDisplay uses atexit to destruct EGL displays
1407         while exiting process. But, when the atexit will be processed,
1408         heap of libGLESv2.dll would be already destructed and causing a
1409         crash on Windows. Do not use atexit for Windows.
1410
1411         AppleWin port does not use PlatformDisplay. Thus, it does not have
1412         this bug.
1413
1414         * platform/graphics/PlatformDisplay.cpp:
1415         (WebCore::PlatformDisplay::initializeEGLDisplay): Do not use atexit for Windows.
1416         (WebCore::PlatformDisplay::shutDownEglDisplays): Added.
1417         * platform/graphics/PlatformDisplay.h: Added a declaration of shutDownEglDisplays.
1418
1419 2017-03-31  Yoav Weiss  <yoav@yoav.ws>
1420
1421         Remove PRELOAD_DEBUG related code.
1422         https://bugs.webkit.org/show_bug.cgi?id=170352
1423
1424         Reviewed by Youenn Fablet.
1425
1426         As the PRELOAD_DEBUG related code stopped building and it seems like no one noticed,
1427         it seems safe to assume that we can remove that code. This patch removes it.
1428
1429         No new tests as there's no functional change.
1430
1431         * loader/cache/CachedResourceLoader.cpp:
1432         (WebCore::CachedResourceLoader::preload):
1433         (WebCore::CachedResourceLoader::clearPreloads):
1434         (WebCore::CachedResourceLoader::printPreloadStats): Deleted.
1435
1436 2017-03-31  Brady Eidson  <beidson@apple.com>
1437
1438         Clean up the "StorageType" enum.
1439         https://bugs.webkit.org/show_bug.cgi?id=170349
1440
1441         Reviewed by Tim Horton.
1442
1443         - Make this `enum` into an `enum class`
1444         - Add a new type specific for "transient local storage"
1445
1446         No new tests (No behavior change).
1447
1448         * WebCore.xcodeproj/project.pbxproj:
1449         
1450         * inspector/InspectorDOMStorageAgent.cpp:
1451         (WebCore::InspectorDOMStorageAgent::didDispatchDOMStorageEvent):
1452         
1453         * inspector/InspectorInstrumentation.h:
1454         
1455         * loader/EmptyClients.cpp:
1456         
1457         * storage/Storage.cpp:
1458         (WebCore::Storage::isDisabledByPrivateBrowsing):
1459         
1460         * storage/StorageArea.h:
1461         (): Deleted.
1462         
1463         * storage/StorageEventDispatcher.cpp:
1464         (WebCore::StorageEventDispatcher::dispatchSessionStorageEventsToFrames):
1465         (WebCore::StorageEventDispatcher::dispatchLocalStorageEventsToFrames):
1466         
1467         * storage/StorageType.h:
1468         (WebCore::isLocalStorage):
1469
1470 2017-03-31  Chris Dumez  <cdumez@apple.com>
1471
1472         Unreviewed, Mark "HTML interactive form validation" as done.
1473
1474         It is shipping in Safari 10.1.
1475  
1476         * features.json:
1477
1478 2017-03-31  Csaba Osztrogonác  <ossy@webkit.org>
1479
1480         Mac cmake buildfix after r214666
1481         https://bugs.webkit.org/show_bug.cgi?id=170342
1482
1483         Unreviewed buildfix.
1484
1485         * PlatformMac.cmake:
1486         * testing/MockPreviewLoaderClient.h:
1487
1488 2017-03-31  Sam Weinig  <sam@webkit.org>
1489
1490         Remove unneeded custom constructors include.
1491
1492         * WebCore.xcodeproj/project.pbxproj:
1493         * bindings/js/ios: Removed.
1494         * bindings/js/ios/TouchConstructors.cpp: Removed.
1495
1496 2017-03-31  John Wilander  <wilander@apple.com>
1497
1498         Resource Load Statistics: Check if the store exists before clearing it
1499         https://bugs.webkit.org/show_bug.cgi?id=170324
1500         <rdar://problem/31258505>
1501
1502         Reviewed by Brent Fulgham.
1503
1504         No new tests. Added a null check.
1505
1506         * loader/ResourceLoadObserver.cpp:
1507         (WebCore::ResourceLoadObserver::clearInMemoryAndPersistentStore):
1508             Added a null check.
1509
1510 2017-03-31  Romain Bellessort  <romain.bellessort@crf.canon.fr>
1511
1512         [Readable Streams API] Implement cloneArrayBuffer in WebCore
1513         https://bugs.webkit.org/show_bug.cgi?id=170008
1514
1515         Reviewed by Youenn Fablet.
1516
1517         Implemented cloneArrayBuffer based on existing structuredCloneArrayBuffer
1518         implementation. The code has been factorized so that both cloneArrayBuffer
1519         and structuredCloneArrayBuffer rely on the same code (which is basically
1520         the previous implementation of structuredCloneArrayBuffer + the ability
1521         to clone only a part of considered buffer).
1522
1523         Added test to check cloneArrayBuffer behaviour.
1524
1525         * Modules/streams/ReadableByteStreamInternals.js: Deleted cloneArrayBuffer JS implementation.
1526         * bindings/js/JSDOMGlobalObject.cpp:
1527         (WebCore::JSDOMGlobalObject::addBuiltinGlobals): Add cloneArrayBuffer private declaration.
1528         * bindings/js/StructuredClone.cpp:
1529         (WebCore::cloneArrayBufferImpl): Added (mostly based on previous structuredCloneArrayBuffer).
1530         (WebCore::cloneArrayBuffer): Added.
1531         (WebCore::structuredCloneArrayBuffer): Updated.
1532         * bindings/js/StructuredClone.h: Added cloneArrayBuffer declaration.
1533         * bindings/js/WebCoreBuiltinNames.h: Added cloneArrayBuffer declaration.
1534         * testing/Internals.cpp: Added support for testing cloneArrayBuffer.
1535         * testing/Internals.h: Added support for testing cloneArrayBuffer.
1536         * testing/Internals.idl: Added support for testing cloneArrayBuffer.
1537
1538 2017-03-31  Antoine Quint  <graouts@apple.com>
1539
1540         [mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout
1541         https://bugs.webkit.org/show_bug.cgi?id=168409
1542         <rdar://problem/30799198>
1543
1544         Unreviewed. Yet more logging to determine under what circumstance ScriptedAnimationController gets suspended.
1545
1546         * dom/Document.cpp:
1547         (WebCore::Document::requestAnimationFrame):
1548
1549 2017-03-30  Zan Dobersek  <zdobersek@igalia.com>
1550
1551         Unreviewed GTK+ build fix. Add missing ANGLE build targets
1552         to the build.
1553
1554         * CMakeLists.txt:
1555
1556 2017-03-30  Simon Fraser  <simon.fraser@apple.com>
1557
1558         Ensure that Node::willBeDeletedFrom() always removes touch event handlers from the document
1559         https://bugs.webkit.org/show_bug.cgi?id=170323
1560         rdar://problem/23647630
1561
1562         Reviewed by Chris Dumez.
1563
1564         There are two instances where nodes are registered as touch event handlers without
1565         having normal touch event listeners: slider thumb elements, and elements with overflow scrolling,
1566         on iOS.
1567
1568         For such nodes, hasEventTargetData() will be false, but we want to ensure
1569         that they are removed from the Document's touchEventHandler set, so move the
1570         call to document.removeTouchEventHandler() outside of the conditional block.
1571
1572         This should be cheap in most cases when the touchEventHandler is empty.
1573
1574         * dom/Node.cpp:
1575         (WebCore::Node::willBeDeletedFrom):
1576
1577 2017-03-30  Simon Fraser  <simon.fraser@apple.com>
1578
1579         Minor cleanup checking for gesture event names
1580         https://bugs.webkit.org/show_bug.cgi?id=170319
1581
1582         Reviewed by Tim Horton.
1583
1584         Just use isGestureEventType() in a couple of places.
1585
1586         * dom/Node.cpp:
1587         (WebCore::tryAddEventListener):
1588         (WebCore::tryRemoveEventListener):
1589
1590 2017-03-30  Simon Fraser  <simon.fraser@apple.com>
1591
1592         Rename a touch event function, and new touch region test results
1593         https://bugs.webkit.org/show_bug.cgi?id=170309
1594         rdar://problem/31329520
1595
1596         Reviewed by Chris Dumez.
1597
1598         Adapt to a naming change in WebKitAdditions.
1599
1600         * dom/Document.cpp:
1601         (WebCore::Document::removeAllEventListeners):
1602         * page/FrameView.cpp:
1603         (WebCore::FrameView::layout):
1604         * rendering/RenderElement.cpp:
1605         (WebCore::RenderElement::styleWillChange):
1606         * rendering/RenderLayer.cpp:
1607         (WebCore::RenderLayer::scrollTo):
1608         (WebCore::RenderLayer::calculateClipRects):
1609
1610 2017-03-30  Matt Rajca  <mrajca@apple.com>
1611
1612         YouTube sometimes does not respect "user gesture" restriction for videos.
1613         https://bugs.webkit.org/show_bug.cgi?id=170297
1614
1615         I discovered a code path that does not honor the "user gesture" requirement and playback is able to begin
1616         even though we have a restriction in place. When using Media Source Extensions, which YouTube does, we transition
1617         from a "Have Metadata" to a "Future Data" state that causes playback to begin, however, we never check
1618         if we have a playback restriction in place.
1619
1620         Reviewed by Eric Carlson.
1621
1622         * html/HTMLMediaElement.cpp:
1623         (WebCore::HTMLMediaElement::setReadyState):
1624
1625 2017-03-30  Said Abou-Hallawa  <sabouhallawa@apple.com>
1626
1627         REGRESSION (r213764): Background image from sprite sheet incorrectly scaled
1628         https://bugs.webkit.org/show_bug.cgi?id=169547
1629
1630         Reviewed by Simon Fraser.
1631
1632         The bug happens when drawing only a rectangle of an image not the whole
1633         image. In BitmapImage::draw(), sizeForDrawing was calculated as the destRect
1634         scaled by the transformation which is applied to the GraphicsContext. Two
1635         problems with this approach. The first one is destRect can be only part of
1636         the image. The second problem is, the ratio destRect / srcRect is another
1637         scaling that needs to be considered.
1638
1639         To fix this issue, first the base size has to be size of the image and not
1640         destRect.size(). Secondly, we need to scale this base size with the context
1641         transformation multiplied by the ratio destRect / srcRect. This scaling is
1642         exactly the same scaling which is calculated in subsamplingScale(). Finally
1643         we use this scaled size as the sizeForDrawing to send to the ImageDecoder.
1644
1645         Test: fast/images/sprite-sheet-image-draw.html
1646
1647         * platform/graphics/BitmapImage.cpp:
1648         (WebCore::BitmapImage::draw): Fix the bug.
1649         (WebCore::BitmapImage::stopAnimation): Stops the async image decoding for animated images only.
1650         The decoding for large images will be stopped when BitmapImage::newFrameNativeImageAvailableAtIndex()
1651         is called and the decoding queue is idle.
1652         (WebCore::BitmapImage::newFrameNativeImageAvailableAtIndex): Add image logging.
1653         * platform/graphics/BitmapImage.h: Move sourceURL() to the Image class.
1654         * platform/graphics/GraphicsContext.cpp: Pass imagePaintingOptions.m_decodingMode to Image::drawTiled().
1655         (WebCore::GraphicsContext::drawTiledImage): Pass imagePaintingOptions.m_decodingMode) to Image::drawTiled().
1656         * platform/graphics/Image.cpp:
1657         (WebCore::Image::sourceURL): Moved from BitmapImage.
1658         (WebCore::Image::drawTiled): Add a DecodingMode argument instead of calling always with DecodingMode::Synchronous.
1659         * platform/graphics/Image.h:
1660         * platform/graphics/ImageFrameCache.cpp:
1661         (WebCore::ImageFrameCache::cacheAsyncFrameNativeImageAtIndex): Add image logging.
1662         (WebCore::ImageFrameCache::startAsyncDecodingQueue): Ditto,
1663         (WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex): Ditto.
1664         (WebCore::ImageFrameCache::stopAsyncDecodingQueue): Ditto.
1665         (WebCore::ImageFrameCache::sourceURL): A helper function to avoid checking the value of m_image.
1666         * platform/graphics/ImageFrameCache.h:
1667         * platform/graphics/NativeImage.h: Rename subsamplingScale() to nativeImageDrawingScale() and return image scaling instead.
1668         * platform/graphics/cairo/NativeImageCairo.cpp:
1669         (WebCore::nativeImageDrawingScale): Ditto.
1670         (WebCore::subsamplingScale): Deleted.
1671         * platform/graphics/cg/NativeImageCG.cpp:
1672         (WebCore::nativeImageDrawingScale): Ditto.
1673         (WebCore::subsamplingScale): Deleted.
1674         * platform/graphics/win/NativeImageDirect2D.cpp:
1675         (WebCore::nativeImageDrawingScale): Ditto.
1676         (WebCore::subsamplingScale): Deleted.
1677
1678 2017-03-30  Matt Baker  <mattbaker@apple.com>
1679
1680         Web Inspector: Assertion failure in InspectorStyleProperty::setRawTextFromStyleDeclaration
1681         https://bugs.webkit.org/show_bug.cgi?id=170279
1682         <rdar://problem/30200492>
1683
1684         Reviewed by David Hyatt.
1685
1686         The SourceRange for a CSSPropertySourceData should be relative to the start
1687         of the declaration body, not the start of the StyleSheetHandler’s parsed
1688         text. This only affected the ranges of unparsed (parsedOK == false) properties
1689         lacking a trailing semi-colon.
1690
1691         This patch doesn't change the behavior of InspectorStyleSheet other than
1692         silencing an irksome assert, as String::substring does a safety check on
1693         the passed in length.
1694
1695         * inspector/InspectorStyleSheet.cpp:
1696         (WebCore::fixUnparsedProperties):
1697
1698 2017-03-30  Youenn Fablet  <youenn@apple.com> and Jon Lee <jonlee@apple.com>
1699
1700         Clean up RTCDataChannel
1701         https://bugs.webkit.org/show_bug.cgi?id=169732
1702
1703         Reviewed by Chris Dumez.
1704
1705         Test: webrtc/datachannel/datachannel-event.html
1706               webrtc/datachannel/bufferedAmountLowThreshold.html
1707
1708         Making RTCDataChannel interface closer to the spec updating implementation accordingly.
1709         See https://w3c.github.io/webrtc-pc/#rtcdatachannel.
1710         In particular adding RTCDataChannelEvent constructor, and missing bufferedAmount related attributes.
1711         Doing some additional cleaning refactoring.
1712
1713         Making bufferedAmountIsDecreasing take a bufferedAmount argument so that we get the actual value passed by
1714         libwebrtc without needing to get it from the libwebrtc network thread again.
1715         In the future, we should store the bufferedAmount value in RTCDataChannel and update its value on each libwebrtc
1716         OnBufferedAmountChange. Special treatment may be needed when the data channel is closed, in which case the bufferedAmount should just be
1717         updated to increase in the send method.
1718
1719         Added some FIXMEs as RTCDataChannel is not aligned with the spec related to send and bufferedAmount.
1720
1721         * Modules/mediastream/RTCDataChannel.cpp:
1722         (WebCore::RTCDataChannel::send):
1723         (WebCore::RTCDataChannel::close):
1724         (WebCore::RTCDataChannel::didChangeReadyState):
1725         (WebCore::RTCDataChannel::bufferedAmountIsDecreasing):
1726         * Modules/mediastream/RTCDataChannel.h:
1727         * Modules/mediastream/RTCDataChannel.idl:
1728         * Modules/mediastream/RTCDataChannelEvent.cpp:
1729         (WebCore::RTCDataChannelEvent::create):
1730         (WebCore::RTCDataChannelEvent::RTCDataChannelEvent):
1731         (WebCore::RTCDataChannelEvent::channel):
1732         * Modules/mediastream/RTCDataChannelEvent.h:
1733         * Modules/mediastream/RTCDataChannelEvent.idl:
1734         * Modules/mediastream/RTCPeerConnection.idl:
1735         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:
1736         (WebCore::LibWebRTCDataChannelHandler::OnStateChange):
1737         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1738         (WebCore::LibWebRTCMediaEndpoint::addDataChannel):
1739         * WebCore.xcodeproj/project.pbxproj:
1740         * dom/EventNames.h:
1741         * platform/mediastream/RTCDataChannelHandler.h:
1742         * platform/mediastream/RTCDataChannelHandlerClient.h:
1743         * platform/mediastream/RTCDataChannelState.h: Added.
1744         * platform/mediastream/RTCPeerConnectionHandlerClient.h:
1745         * platform/mock/RTCDataChannelHandlerMock.cpp:
1746         (WebCore::RTCDataChannelHandlerMock::setClient):
1747         (WebCore::RTCDataChannelHandlerMock::close):
1748         * platform/mock/RTCNotifiersMock.cpp:
1749         (WebCore::IceConnectionNotifier::IceConnectionNotifier):
1750         (WebCore::SignalingStateNotifier::SignalingStateNotifier):
1751         (WebCore::DataChannelStateNotifier::DataChannelStateNotifier):
1752         * platform/mock/RTCNotifiersMock.h:
1753
1754 2017-03-30  Javier Fernandez  <jfernandez@igalia.com>
1755
1756         [css-align] Adapt content-alignment properties to the new baseline syntax
1757         https://bugs.webkit.org/show_bug.cgi?id=170262
1758
1759         Reviewed by David Hyatt.
1760
1761         The baseline-position syntax has changed recently, so we need to update
1762         the CSS properties using the old syntax. This patch address only the
1763         content-alignment (align-content and justify-content).
1764
1765         I used this patch to adapt the implementation of the parsing logic for
1766         these properties to the new Blink's CSS Parsing Design.
1767
1768         The new baseline syntax is "[first | last ]? baseline" which implies
1769         modifying the parsing and computed value logic.
1770
1771         There are several layout tests affected by this change, so I'll update
1772         them accordingly.
1773
1774         No new tests, just added/modified some cases to the tests we
1775         already have using the new baseline values.
1776
1777         * css/CSSComputedStyleDeclaration.cpp:
1778         (WebCore::valueForContentPositionAndDistributionWithOverflowAlignment):
1779         * css/CSSContentDistributionValue.cpp:
1780         (WebCore::CSSContentDistributionValue::customCSSText):
1781         * css/CSSPrimitiveValueMappings.h:
1782         (WebCore::CSSPrimitiveValue::operator ItemPosition):
1783         (WebCore::CSSPrimitiveValue::operator ContentPosition):
1784         * css/CSSValueKeywords.in:
1785         * css/parser/CSSPropertyParser.cpp:
1786         (WebCore::isBaselineKeyword):
1787         (WebCore::consumeBaselineKeyword):
1788         (WebCore::consumeContentDistributionOverflowPosition):
1789         (WebCore::consumeSelfPositionOverflowPosition):
1790
1791 2017-03-30  James Craig  <jcraig@apple.com>
1792
1793         AX: Expose a new AXSubrole for explicit ARIA "group" role
1794         https://bugs.webkit.org/show_bug.cgi?id=169810
1795         <rdar://problem/31039693>
1796
1797         Reviewed by Chris Fleizach.
1798
1799         Split GroupRole into generics (GroupRole) and explicit groups 
1800         (ApplicationGroupRole) so we can expose a subrole on the explicit 
1801         groups. Account for the change in ARIA Tree and Menu hierachies. 
1802         Update the computedRoleValue for WebKit Inspector usage, too.
1803
1804         Updated existing tests.
1805
1806         Test: accessibility/list-detection2.html:
1807         Test: accessibility/roles-computedRoleString.html:
1808         Test: inspector/dom/getAccessibilityPropertiesForNode.html:
1809         Test: inspector/dom/highlightFrame.html:
1810         Test: inspector/dom/highlightSelector.html:
1811
1812         * accessibility/AccessibilityNodeObject.cpp:
1813         (WebCore::AccessibilityNodeObject::helpText):
1814         (WebCore::AccessibilityNodeObject::hierarchicalLevel):
1815         (WebCore::AccessibilityNodeObject::remapAriaRoleDueToParent):
1816         * accessibility/AccessibilityObject.cpp:
1817         (WebCore::AccessibilityObject::accessibleNameDerivesFromContent):
1818         (WebCore::AccessibilityObject::ariaTreeItemContent):
1819         (WebCore::initializeRoleMap):
1820         (WebCore::AccessibilityObject::computedRoleString):
1821         * accessibility/AccessibilityObject.h:
1822         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1823         (atkRole):
1824         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1825         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
1826         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1827         (createAccessibilityRoleMap):
1828         (-[WebAccessibilityObjectWrapper subrole]):
1829
1830 2017-03-30  Chris Dumez  <cdumez@apple.com>
1831
1832         We are spending a lot of time bzero'ing AudioChannel buffers on uni-watch.com
1833         https://bugs.webkit.org/show_bug.cgi?id=170288
1834         <rdar://problem/31289132>
1835
1836         Reviewed by Eric Carlson.
1837
1838         We are spending a lot of time bzero'ing AudioChannel buffers on uni-watch.com due
1839         to doubleclick ads using WebAudio with a 0-gain GainNode. We should optimize the
1840         0-gain case as much as possible.
1841
1842         No new tests, only an optimization.
1843
1844         * Modules/webaudio/AudioNode.cpp:
1845         (WebCore::AudioNode::processIfNecessary):
1846         Drop call to unsilenceOutputs() before calling AudioNode::process(). The AudioChannel
1847         API already takes care of clearing its 'silent' flag whenever its buffer changes so
1848         there should be no need to explicitly clearing the 'silent' flag before calling
1849         process(). This was causing us to zero out buffers that were already filled with
1850         zeros because AudioChannel::zero() would no longer return early, not knowing the
1851         channel is already silent. This reduces the number of bzero() calls by ~3.5x on
1852         uni-watch.com (from 100 calls every ~20ms to 100 calls every ~70ms.
1853
1854         * Modules/webaudio/AudioNode.h:
1855         * platform/audio/mac/AudioDestinationMac.cpp:
1856         (WebCore::AudioDestinationMac::render):
1857         Avoid clamping the values in the channel buffer if the channel is silent since this
1858         will have no effect (given that the buffer only contains zeros).
1859
1860 2017-03-30  Eric Carlson  <eric.carlson@apple.com>
1861
1862         [Crash] WebCore::AudioBuffer::AudioBuffer don't checking illegal value
1863         https://bugs.webkit.org/show_bug.cgi?id=169956
1864
1865         Reviewed by Youenn Fablet.
1866
1867         Test: webaudio/audiobuffer-crash.html
1868
1869         * Modules/webaudio/AudioBuffer.cpp:
1870         (WebCore::AudioBuffer::AudioBuffer): Invalidate the object and return early if the channel 
1871         array allocation fails.
1872         (WebCore::AudioBuffer::AudioBuffer): Ditto.
1873         (WebCore::AudioBuffer::invalidate): Invalidate the object.
1874         * Modules/webaudio/AudioBuffer.h:
1875
1876 2017-03-30  Antoine Quint  <graouts@apple.com>
1877
1878         [mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout
1879         https://bugs.webkit.org/show_bug.cgi?id=168409
1880         <rdar://problem/30799198>
1881
1882         Unreview. Print the backtrace when we suspend scripted animations.
1883
1884         * page/Page.cpp:
1885         (WebCore::Page::suspendScriptedAnimations):
1886
1887 2017-03-30  Antoine Quint  <graouts@apple.com>
1888
1889         [mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout
1890         https://bugs.webkit.org/show_bug.cgi?id=168409
1891         <rdar://problem/30799198>
1892
1893         Unreview. Pring the backtrace when we suspend ScriptedAnimationController.
1894
1895         * dom/ScriptedAnimationController.cpp:
1896         (WebCore::ScriptedAnimationController::suspend):
1897
1898 2017-03-30  Antoine Quint  <graouts@apple.com>
1899
1900         [Modern Media Controls] Invalid placard icon is not visible for short video
1901         https://bugs.webkit.org/show_bug.cgi?id=170277
1902         <rdar://problem/31327955>
1903
1904         Reviewed by Eric Carlson.
1905
1906         Make the minimum dimension needed to display a placard icon configurable and let the
1907         invalid placard use a 50pt dimension. We also make a drive-by fix to reset "text-align"
1908         for media controls as having a "text-align: center" inherited value would mess up
1909         positioning of the placard icon and make it flush to the right of the placard.
1910
1911         Test: media/modern-media-controls/invalid-placard/invalid-placard-constrained-metrics.html
1912
1913         * Modules/modern-media-controls/controls/invalid-placard.js:
1914         (InvalidPlacard):
1915         * Modules/modern-media-controls/controls/media-controls.css:
1916         (.media-controls):
1917         * Modules/modern-media-controls/controls/placard.js:
1918         (Placard.prototype.layout):
1919
1920 2017-03-30  Zan Dobersek  <zdobersek@igalia.com>
1921
1922         [GCrypt] Register missing algorithms in CryptoAlgorithmRegistry::platformRegisterAlgoritmhs()
1923         https://bugs.webkit.org/show_bug.cgi?id=170273
1924
1925         Reviewed by Michael Catanzaro.
1926
1927         * crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp:
1928         (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
1929         Add registerAlgorithm<> calls for AES_CFB, AES_GCM, ECDH and
1930         PBKDF2 algorithms.
1931
1932 2017-03-30  Brent Fulgham  <bfulgham@apple.com>
1933
1934         Remove unused MediaControlsApple implementation
1935         https://bugs.webkit.org/show_bug.cgi?id=170258
1936         <rdar://problem/31331056>
1937
1938         Reviewed by Eric Carlson.
1939
1940         Remove dead code related to old media controls. We switched to HTML5-based media controls
1941         several years ago.
1942
1943         No new tests. Removing this dead code should have no change in behavior.
1944
1945         * WebCore.xcodeproj/project.pbxproj: Remove unused files.
1946         * dom/EventListener.h: Remove unused event type.
1947         * html/shadow/MediaControlsApple.cpp: Removed.
1948         * html/shadow/MediaControlsApple.h: Removed.
1949
1950 2017-03-30  Fujii Hironori  <Hironori.Fujii@sony.com>
1951
1952         [WinCairo] ImageCairoWin.cpp: error C2660: 'WebCore::BitmapImage::draw': function does not take 6 arguments
1953         https://bugs.webkit.org/show_bug.cgi?id=170275
1954
1955         Reviewed by Said Abou-Hallawa.
1956
1957         Apply the similar change of ImageCGWin.cpp of r214450 to ImageCairoWin.cpp.
1958
1959         * platform/graphics/win/ImageCairoWin.cpp:
1960         (WebCore::BitmapImage::getHBITMAPOfSize): Pass DecodingMode::Synchronous to Image::draw().
1961         (WebCore::BitmapImage::drawFrameMatchingSourceSize): Ditto.
1962
1963 2017-03-27  Sergio Villar Senin  <svillar@igalia.com>
1964
1965         [css-grid] Clamp the number of autorepeat tracks
1966         https://bugs.webkit.org/show_bug.cgi?id=170120
1967
1968         Reviewed by Manuel Rego Casasnovas.
1969
1970         As suggested by the specs we do clamp the maximum number of tracks per grid in order to
1971         minimize potential OOM situations. However we were not considering the case of the recently
1972         added auto repeat syntax. Abnormally huge values for the width/height on the grid container
1973         could lead to a number of auto repeat tracks higher than the maximum.
1974
1975         A new API was added to Internals in order to test limits without having to create huge
1976         grids. This new API allows clients to set an arbitrary limit to the number of tracks. The
1977         addition of this new API forced us to add GridPosition.cpp to the project to define the
1978         global variable we use for testing. We took the chance to move part of the implementation
1979         from the header file to the source file.
1980
1981         Last but not least, several new ASSERTs were added to Grid.cpp implementation to ensure that
1982         we do not surpass the grid track limits.
1983
1984         Test: fast/css-grid-layout/grid-auto-repeat-huge-grid.html
1985
1986         * CMakeLists.txt:
1987         * WebCore.xcodeproj/project.pbxproj:
1988         * css/parser/CSSPropertyParser.cpp:
1989         (WebCore::consumeGridTrackRepeatFunction):
1990         * rendering/Grid.cpp:
1991         (WebCore::Grid::ensureGridSize): Added ASSERT.
1992         (WebCore::Grid::setSmallestTracksStart): Ditto.
1993         (WebCore::Grid::setAutoRepeatTracks): Ditto.
1994         (WebCore::Grid::setAutoRepeatEmptyColumns): Ditto.
1995         (WebCore::Grid::setAutoRepeatEmptyRows): Ditto.
1996         * rendering/RenderGrid.cpp:
1997         (WebCore::RenderGrid::clampAutoRepeatTracks): New method.
1998         (WebCore::RenderGrid::placeItemsOnGrid): Clamp the number of auto repeat tracks before
1999         passing them to the Grid.
2000         * rendering/RenderGrid.h:
2001         * rendering/style/GridArea.h:
2002         (WebCore::GridSpan::GridSpan):
2003         * rendering/style/GridPosition.cpp: Added.
2004         (WebCore::GridPosition::setExplicitPosition):
2005         (WebCore::GridPosition::setAutoPosition):
2006         (WebCore::GridPosition::setSpanPosition):
2007         (WebCore::GridPosition::setNamedGridArea):
2008         (WebCore::GridPosition::integerPosition):
2009         (WebCore::GridPosition::namedGridLine):
2010         (WebCore::GridPosition::spanPosition):
2011         (WebCore::GridPosition::operator==):
2012         * rendering/style/GridPosition.h:
2013         (WebCore::GridPosition::shouldBeResolvedAgainstOppositePosition):
2014         (WebCore::GridPosition::max):
2015         (WebCore::GridPosition::min):
2016         (WebCore::GridPosition::setMaxPositionForTesting):
2017         (WebCore::GridPosition::setExplicitPosition): Deleted.
2018         (WebCore::GridPosition::setAutoPosition): Deleted.
2019         (WebCore::GridPosition::setSpanPosition): Deleted.
2020         (WebCore::GridPosition::setNamedGridArea): Deleted.
2021         (WebCore::GridPosition::integerPosition): Deleted.
2022         (WebCore::GridPosition::namedGridLine): Deleted.
2023         (WebCore::GridPosition::spanPosition): Deleted.
2024         (WebCore::GridPosition::operator==): Deleted.
2025         * rendering/style/GridPositionsResolver.cpp:
2026         (WebCore::GridPositionsResolver::explicitGridColumnCount):
2027         (WebCore::GridPositionsResolver::explicitGridRowCount):
2028         * testing/Internals.cpp:
2029         (WebCore::Internals::setGridMaxTracksLimit):
2030         * testing/Internals.h:
2031         * testing/Internals.idl:
2032
2033 2017-03-29  Ryosuke Niwa  <rniwa@webkit.org>
2034
2035         Disconnecting a HTMLObjectElement does not always unload its content document
2036         https://bugs.webkit.org/show_bug.cgi?id=169606
2037
2038         Reviewed by Andy Estes.
2039
2040         When removing a node, we first disconnect all subframes then update the focused element as we remove each child.
2041         However, when the removed element is a focused object element with a content document, removeFocusedNodeOfSubtree
2042         can update the style tree synchronously inside Document::setFocusedElement, and reload the document.
2043
2044         Avoid this by instantiating a SubframeLoadingDisabler on the parent of the focused element.
2045
2046         Test: fast/dom/removing-focused-object-element.html
2047
2048         * dom/Document.cpp:
2049         (WebCore::Document::removeFocusedNodeOfSubtree):
2050
2051 2017-03-29  Myles C. Maxfield  <mmaxfield@apple.com>
2052
2053         Migrate to kCTFontCSSWidthAttribute
2054         https://bugs.webkit.org/show_bug.cgi?id=170265
2055
2056         Reviewed by Darin Adler.
2057
2058         Previously, we were mapping from Core Text widths to CSS widths in WebKit.
2059         However, on some OSes, Core Text can directly tell us what the CSS width
2060         value is.
2061
2062         No new tests because there is no behavior change.
2063
2064         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2065         (WebCore::getCSSAttribute):
2066         (WebCore::capabilitiesForFontDescriptor):
2067         * platform/spi/cocoa/CoreTextSPI.h:
2068
2069 2017-03-28  Simon Fraser  <simon.fraser@apple.com>
2070
2071         Make it possible to dump touch event regions for testing
2072         https://bugs.webkit.org/show_bug.cgi?id=170209
2073         <rdar://problem/31309258>
2074
2075         Reviewed by Tim Horton.
2076
2077         Expose internals.touchEventRectsForEvent() and internals.passiveTouchEventListenerRects(), which
2078         fetch data via Page.
2079
2080         Because the regions are normally updated on a timer, we have to force an eager update via Document::updateTouchEventRegions().
2081
2082         Test: fast/events/touch/ios/touch-event-regions.html
2083
2084         * page/Page.cpp:
2085         (WebCore::Page::nonFastScrollableRects):
2086         (WebCore::Page::touchEventRectsForEvent):
2087         (WebCore::Page::passiveTouchEventListenerRects):
2088         * page/Page.h:
2089         * testing/Internals.cpp:
2090         (WebCore::Internals::touchEventRectsForEvent):
2091         (WebCore::Internals::passiveTouchEventListenerRects):
2092         * testing/Internals.h:
2093         * testing/Internals.idl:
2094
2095 2017-03-29  Zalan Bujtas  <zalan@apple.com>
2096
2097         RenderBlockFlow::addFloatsToNewParent should check if float is already added to the object list.
2098         https://bugs.webkit.org/show_bug.cgi?id=170259
2099         <rdar://problem/31300584>
2100
2101         Reviewed by Simon Fraser.
2102
2103         r210145 assumed that m_floatingObjects would simply ignore the floating box if it was already in the list.  
2104
2105         Test: fast/block/float/placing-multiple-floats-crash.html
2106
2107         * rendering/RenderBlockFlow.cpp:
2108         (WebCore::RenderBlockFlow::addFloatsToNewParent):
2109
2110 2017-03-29  Myles C. Maxfield  <mmaxfield@apple.com>
2111
2112         Try to normalize variation ranges
2113         https://bugs.webkit.org/show_bug.cgi?id=170119
2114
2115         Unreviewed.
2116
2117         Addressing post-review comment.
2118
2119         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2120         (WebCore::isGXVariableFont):
2121
2122 2017-03-29  Myles C. Maxfield  <mmaxfield@apple.com>
2123
2124         Try to normalize variation ranges
2125         https://bugs.webkit.org/show_bug.cgi?id=170119
2126
2127         Reviewed by Simon Fraser.
2128
2129         TrueType GX-style variation fonts use one particular scale for values on their
2130         weight/width/slope axes - usually the values lie between -1 and 1 on that scale.
2131         However, OpenType 1.8-style fonts use the CSS scale for values on these axes.
2132         For the purposes of font selection, these values need to lie on the same scale.
2133         However, when font selection is completed and the variation values are actually
2134         being applied to the fonts, values which lie on the font's actual scale need to
2135         be applied. This patch adds normalize*() and denormalize*() functions to perform
2136         both of these operations. 
2137
2138         The conversion itself between the two scales isn't an exact mapping. Mapping
2139         slope is just a linear relationship with 0deg <=> 0 and 20deg <=> 1 (as per the
2140         CSS Fonts spec). Mapping widths is similar, it uses a 2-component piecewise
2141         linear relationship which includes the values given in the Microsoft OpenType
2142         spec for the OS/2 table's usWidthClass field. Weights are more difficult, so I
2143         plotted the CSS weights and the GX-style weights for every style of San
2144         Francisco, saw that the relationship appears to be linear, and ran a linear
2145         regression to compute the line equation.
2146
2147         As for the actual discrimination of determining whether a font is a GX-style
2148         font or not, we can use the presence of the 'STAT' table. This table didn't
2149         exist when GX fonts were being created, and OpenType 1.8 variable fonts are
2150         required to have this table.
2151
2152         Facebook uses the string ".SFNSText" in their @font-face blocks. This font is
2153         a variation font, but uses the GX-style values. Facebook asks us to create
2154         this font with a weight of 700, and because the values in the font are around
2155         1.0, we were erroneously thinking that the font wasn't bold, so we were then
2156         applying synthetic bold. This was causing text on facebook to look fuzzy and
2157         ugly.
2158
2159         Test: fast/text/variations/font-selection-properties-expected.html
2160
2161         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2162         (WebCore::isGXVariableFont):
2163         (WebCore::normalizeWeight):
2164         (WebCore::normalizeSlope):
2165         (WebCore::denormalizeWeight):
2166         (WebCore::denormalizeWidth):
2167         (WebCore::denormalizeSlope):
2168         (WebCore::normalizeWidth):
2169         (WebCore::preparePlatformFont): Instead of using FontSelectionValues for the
2170         intermediate values, we should use floats instead. This is because
2171         FontSelectionValues are fixed-point numbers with the denominator having 2 bits.
2172         When using this data type to represent values on the GX scale, which are usually
2173         between 0 and 1, you lose a lot of fidelity. Instead, our intermediate
2174         calculations should be done with floats, and converted to FontSelectionValues at
2175         the end when they are representative of values on the CSS scale.
2176         (WebCore::stretchFromCoreTextTraits):
2177         (WebCore::fontWeightFromCoreText):
2178         (WebCore::extractVariationBounds):
2179         (WebCore::variationCapabilitiesForFontDescriptor):
2180         (WebCore::capabilitiesForFontDescriptor):
2181
2182 2017-03-29  Saam Barati  <sbarati@apple.com>
2183
2184         LinkBuffer and ExecutableAllocator shouldn't have anything to do with VM
2185         https://bugs.webkit.org/show_bug.cgi?id=170210
2186
2187         Reviewed by Mark Lam.
2188
2189         * cssjit/SelectorCompiler.cpp:
2190         (WebCore::SelectorCompiler::compileSelector):
2191         (WebCore::SelectorCompiler::SelectorCodeGenerator::compile):
2192
2193 2017-03-29  Javier Fernandez  <jfernandez@igalia.com>
2194
2195         [css-align] Adapt self-alignment properties to the new baseline syntax
2196         https://bugs.webkit.org/show_bug.cgi?id=170235
2197
2198         Reviewed by David Hyatt.
2199
2200         The baseline-position syntax has changed recently, so we need to update
2201         the CSS properties using the old syntax. This patch address only the
2202         self-alignment (align-self and justify-self) and default-alignment
2203         (align-items and justify-items).
2204
2205         The content-distribution properties (align-content and justify-content)
2206         will be updated in a follow up patch.
2207
2208         The new baseline syntax is "[first | last ]? baseline" which implies
2209         modifying the parsing and computed value logic.
2210
2211         There are several layout tests affected by this change, so I'll update
2212         them accordingly.
2213
2214         No new tests, just added/modified some cases to the tests we already have using the new baseline values.
2215
2216         * css/CSSComputedStyleDeclaration.cpp:
2217         (WebCore::valueForItemPositionWithOverflowAlignment):
2218         * css/CSSValueKeywords.in:
2219         * css/StyleBuilderConverter.h:
2220         (WebCore::StyleBuilderConverter::convertSelfOrDefaultAlignmentData):
2221         * css/parser/CSSPropertyParser.cpp:
2222         (WebCore::consumeBaselineKeyword):
2223         (WebCore::consumeSelfPositionOverflowPosition):
2224
2225 2017-03-29  Chris Dumez  <cdumez@apple.com>
2226
2227         Animated SVG images are not paused in pages loaded in the background
2228         https://bugs.webkit.org/show_bug.cgi?id=170043
2229         <rdar://problem/31234412>
2230
2231         Reviewed by Simon Fraser.
2232
2233         Animated SVG images are not paused in pages loaded in the background. We rely
2234         on FrameView::isOffscreen() to stop images animations in background tab (See
2235         logic in RenderElement's shouldRepaintForImageAnimation()). This works fine
2236         if a tab is visble and then becomes hidden (i.e. by switching to another
2237         tab). However, in the case where the tab gets loaded while in the background
2238         (e.g. opening link in new background tab, or session restore), then the
2239         animations would not be paused, due to FrameView::isOffscreen() erroneously
2240         returning false in this case.
2241
2242         Normally, the following chain of events happens:
2243         - Page is visible, we construct a main frame and its FrameView for loading
2244           the page. When a FrameView is constructed, we call FrameView::show() to
2245           make it visible. Then, if the page becomes non-visible, we call
2246           Page::setIsVisibleInternal(false) which calls FrameView::hide(). After
2247           that, FrameView::isOffscreen() correctly returns true because we properly
2248           called FrameView::hide().
2249
2250         However, when doing a load while the Page is hidden, the following was
2251         happening:
2252         - Page is not visible, we call Page::setIsVisibleInternal(false) which tries
2253           to call FrameView::hide() for the main frame but it does not have a FrameView
2254           yet (because the load has not started). We start the load and end up creating
2255           a FrameView. The FrameView constructor was calling FrameView::show()
2256           unconditionally, thus making the FrameView think is visible, even though its
2257           page isn't. At this point, FrameView::isOffscreen() was returning false
2258           and animations would keep running, even though the page is not visible.
2259
2260         To address the issue, we now call FrameView::show() in FrameView::create() only
2261         if the Page is actually visible, instead of calling it unconditionally. If the
2262         page ever becomes visible, Page::setIsVisibleInternal(true) will be called and
2263         it will take care of calling FrameView::show() then.
2264
2265         Tests: svg/animations/animations-paused-in-background-page-iframe.html
2266                svg/animations/animations-paused-in-background-page.html
2267
2268         * page/FrameView.cpp:
2269         (WebCore::FrameView::create):
2270
2271 2017-03-29  Wenson Hsieh  <wenson_hsieh@apple.com>
2272
2273         Links with empty hrefs should not be drag sources
2274         https://bugs.webkit.org/show_bug.cgi?id=170241
2275         <rdar://problem/31305505>
2276
2277         Reviewed by Tim Horton.
2278
2279         The m_dragSouceAction member of DragController represents the drag source actions that are available to the
2280         document, rather than the available actions given the dragging element. Thus, it is not correct to only check
2281         that (m_dragSourceAction & DragSourceActionAttachment) before proceeding down the attachment dragging codepath.
2282         This should be additionally guarded with a check that the element being dragged is, in fact, an attachment
2283         element.
2284
2285         New API test (see Tools/ChangeLog).
2286
2287         * page/DragController.cpp:
2288         (WebCore::DragController::startDrag):
2289
2290 2017-03-29  Jeremy Jones  <jeremyj@apple.com>
2291
2292         WebVideoFullscreenInterfaceAVKit needs a strong self ref before dispatching to the main thread.
2293         https://bugs.webkit.org/show_bug.cgi?id=170129
2294
2295         Reviewed by David Kilzer.
2296
2297         No new tests becuase no new behavior.
2298
2299         Hold a strong reference to WebVideoFullscreenInterfaceAVKit when dispatching to the main thread.
2300         Make WebVideoFullscreenInterfaceAVKit safe to retain from non-main thread.
2301
2302         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
2303         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2304         (WebVideoFullscreenInterfaceAVKit::exitFullscreen):
2305
2306 2017-03-29  Zan Dobersek  <zdobersek@igalia.com>
2307
2308         [GCrypt] Add a Handle<> class to help with GCrypt object lifetime control
2309         https://bugs.webkit.org/show_bug.cgi?id=170238
2310
2311         Reviewed by Michael Catanzaro.
2312
2313         The platform-specific CryptoAlgorithmHMAC implementation is modified
2314         to showcase the GCrypt::Handle<> use. HandleDeleter<gcry_mac_hd_t>
2315         is added accordingly.
2316
2317         * crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:
2318         (WebCore::calculateSignature):
2319
2320 2017-03-29  Myles C. Maxfield  <mmaxfield@apple.com>
2321
2322         Variation fonts: Make sure that feature detection and preprocessor macros are right
2323         https://bugs.webkit.org/show_bug.cgi?id=169518
2324
2325         Reviewed by Simon Fraser.
2326
2327         When I added variable fonts support, I made all OSes parse the newly accepted values,
2328         instead of just the OSes which support variable fonts.
2329
2330         Test: fast/text/font-variations-feature-detection.html
2331
2332         * css/parser/CSSPropertyParser.cpp:
2333         (WebCore::consumeFontStretch):
2334         (WebCore::consumeFontStyle):
2335         * css/parser/CSSPropertyParserHelpers.cpp:
2336         (WebCore::CSSPropertyParserHelpers::divisibleBy100):
2337         (WebCore::CSSPropertyParserHelpers::consumeFontWeightNumber):
2338
2339 2017-03-29  Antoine Quint  <graouts@apple.com>
2340
2341         [Modern Media Controls] Controls bar may disappear while captions menu is visible (redux)
2342         https://bugs.webkit.org/show_bug.cgi?id=170239
2343         <rdar://problem/31320685>
2344
2345         Reviewed by Dean Jackson.
2346
2347         We did some work in webkit.org/b/168751 to prevent the controls bar from disappearing while the
2348         captions menu is visible. But there were two cases where the behavior was not as intended:
2349
2350             1. the controls bar would hide upon exiting the video.
2351             2. clicking on the controls bar while the caption panel is up would hide the controls bar
2352                as well as the captions panel.
2353
2354         Instead of determining that the "userInteractionEnabled" property being set to "false" is indicative
2355         of secondary UI, such as the tracks panel, being attached to the controls bar, we now have an
2356         explicit property to specify this. Now, when "hasSecondaryUIAttached" is "true", we prevent the
2357         controls bar from fading when exiting the media.
2358
2359         Additionally, when dismissing the tracks panel, we check whether a mouse event lead to this and check
2360         if the mouse was positioned over the controls bar. If that is the case, we no longer hide the controls
2361         bar and only dismiss the tracks panel.
2362
2363         Test: media/modern-media-controls/tracks-panel/tracks-panel-controls-bar-remains-visible-after-clicking-over-it.html
2364
2365         * Modules/modern-media-controls/controls/controls-bar.js:
2366         (ControlsBar.prototype.set userInteractionEnabled):
2367         (ControlsBar.prototype.handleEvent):
2368         (ControlsBar.prototype._autoHideTimerFired):
2369         * Modules/modern-media-controls/controls/macos-media-controls.js:
2370         (MacOSMediaControls.prototype.showTracksPanel):
2371         (MacOSMediaControls.prototype.hideTracksPanel):
2372
2373 2017-03-29  Antoine Quint  <graouts@apple.com>
2374
2375         [Modern Media Controls] Volume slider is initially empty
2376         https://bugs.webkit.org/show_bug.cgi?id=170237
2377         <rdar://problem/31319077>
2378
2379         Reviewed by Dean Jackson.
2380
2381         Fixing fallout from https://bugs.webkit.org/show_bug.cgi?id=167935 where we changed the behavior
2382         of layout() to happen prior to a commit. In this one instance, we were overriding layout() to run
2383         after a commit, so we now override commit(). Otherwise, the <canvas> that we draw the volume slider
2384         into would have its "width" and "height" properties set after we drew, which would clear the <canvas>.
2385
2386         * Modules/modern-media-controls/controls/slider.js:
2387         (Slider.prototype.commit):
2388         (Slider.prototype.layout): Deleted.
2389
2390 2017-03-29  Zan Dobersek  <zdobersek@igalia.com>
2391
2392         [GCrypt] Move over empty GnuTLS-based SUBTLE_CRYPTO implementation files
2393         https://bugs.webkit.org/show_bug.cgi?id=170232
2394
2395         Reviewed by Michael Catanzaro.
2396
2397         Migrate the GnuTLS SUBTLE_CRYPTO implementation files to the gcrypt/
2398         directory. The implementation files themselves are no-op, so this is
2399         a simple move-and-rename operation that will enable proceeding with
2400         the libgcrypt-based implementation of SUBTLE_CRYPTO functionality.
2401
2402         No change in behavior. The SUBTLE_CRYPTO feature should build as it
2403         did before, and the implementations are empty anyway.
2404
2405         * PlatformGTK.cmake:
2406         * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmAES_CBCGnuTLS.cpp.
2407         * crypto/gcrypt/CryptoAlgorithmAES_CFBGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmAES_CFBGnuTLS.cpp.
2408         * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmAES_GCMGnuTLS.cpp.
2409         * crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmAES_KWGnuTLS.cpp.
2410         * crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmECDHGnuTLS.cpp.
2411         * crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmPBKDF2GnuTLS.cpp.
2412         * crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmRSAES_PKCS1_v1_5GnuTLS.cpp.
2413         * crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp: This one already exists.
2414         * crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmRSA_OAEPGnuTLS.cpp.
2415         * crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmRegistryGnuTLS.cpp.
2416         * crypto/gcrypt/CryptoKeyECGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoKeyECGnuTLS.cpp.
2417         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoKeyRSAGnuTLS.cpp.
2418         * crypto/gcrypt/SerializedCryptoKeyWrapGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/SerializedCryptoKeyWrapGnuTLS.cpp.
2419         * crypto/gnutls/CryptoAlgorithmRSASSA_PKCS1_v1_5GnuTLS.cpp: Removed.
2420
2421 2017-03-29  Zan Dobersek  <zdobersek@igalia.com>
2422
2423         [GnuTLS] Remove unused CryptoDigestGnuTLS, CryptoAlgorithmHMACGnuTLS implementation files
2424         https://bugs.webkit.org/show_bug.cgi?id=170231
2425
2426         Reviewed by Michael Catanzaro.
2427
2428         * crypto/gnutls/CryptoAlgorithmHMACGnuTLS.cpp: Removed. The GCrypt counterpart
2429         is already in use, and this file wasn't even being built.
2430
2431 2017-03-29  Youenn Fablet  <youenn@apple.com>
2432
2433         Move DTMF WebRTC extension behind its own compile flag
2434         https://bugs.webkit.org/show_bug.cgi?id=170226
2435
2436         Reviewed by Eric Carlson.
2437
2438         Moving RTCDTMFSender and RTCDTMFToneChangeEvent behinf a WEB_RTC_DTMF compile flag.
2439         This compile flag is not set on any supported platform yet.
2440         Disabling related test and updated test expectations.
2441
2442         * Modules/mediastream/RTCDTMFSender.cpp:
2443         * Modules/mediastream/RTCDTMFSender.h:
2444         * Modules/mediastream/RTCDTMFSender.idl:
2445         * Modules/mediastream/RTCDTMFToneChangeEvent.cpp:
2446         * Modules/mediastream/RTCDTMFToneChangeEvent.h:
2447         * Modules/mediastream/RTCDTMFToneChangeEvent.idl:
2448         * dom/EventNames.in:
2449         * dom/EventTargetFactory.in:
2450         * platform/mediastream/RTCDTMFSenderHandler.h:
2451         * platform/mediastream/RTCDTMFSenderHandlerClient.h:
2452
2453 2017-03-29  Antoine Quint  <graouts@apple.com>
2454
2455         [mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout
2456         https://bugs.webkit.org/show_bug.cgi?id=168409
2457         <rdar://problem/30799198>
2458
2459         Reviewed by Dean Jackson.
2460
2461         Add a new internals setting to opt into ScriptedAnimationController logging through DOM events dispatched
2462         through the document. This should allow this flaky test to get information as to why the frame isn't
2463         firing when it times out.
2464
2465         * dom/ScriptedAnimationController.cpp:
2466         (WebCore::ScriptedAnimationController::suspend):
2467         (WebCore::ScriptedAnimationController::resume):
2468         (WebCore::ScriptedAnimationController::addThrottlingReason):
2469         (WebCore::ScriptedAnimationController::removeThrottlingReason):
2470         (WebCore::ScriptedAnimationController::registerCallback):
2471         (WebCore::ScriptedAnimationController::cancelCallback):
2472         (WebCore::ScriptedAnimationController::serviceScriptedAnimations):
2473         (WebCore::ScriptedAnimationController::scheduleAnimation):
2474         (WebCore::ScriptedAnimationController::dispatchLoggingEventIfRequired):
2475         * dom/ScriptedAnimationController.h:
2476         * page/Settings.in:
2477         * testing/InternalSettings.cpp:
2478         (WebCore::InternalSettings::resetToConsistentState):
2479         (WebCore::InternalSettings::shouldDispatchRequestAnimationFrameEvents):
2480         (WebCore::InternalSettings::setShouldDispatchRequestAnimationFrameEvents):
2481         * testing/InternalSettings.h:
2482         * testing/InternalSettings.idl:
2483
2484 2017-03-28  Youenn Fablet  <youenn@apple.com>
2485
2486         [WebRTC] After r214441 addIceCandidate no longer accepts an RTCIceCandidateInit dictionary
2487         https://bugs.webkit.org/show_bug.cgi?id=170192
2488
2489         Reviewed by Jon Lee.
2490
2491         Covered by updated tests.
2492
2493         * Modules/mediastream/RTCIceCandidate.idl: Candidate is no longer a required field in RTCIceCandidateInit.
2494         * Modules/mediastream/RTCPeerConnectionInternals.js: Reworking defaultsToNull to handle both undefined and null cases.
2495
2496 2017-03-28  Youenn Fablet  <youenn@apple.com>
2497
2498         LibWebRTCProvider should allow setting encoder and decoder factories
2499         https://bugs.webkit.org/show_bug.cgi?id=170212
2500
2501         Reviewed by Eric Carlson.
2502
2503         No change of behavior.
2504         Adding the ability to set encoder/decoder libwebrtc factory getters.
2505         Setting default cocoa factory getters.
2506
2507         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
2508         (WebCore::staticFactoryAndThreads):
2509         (WebCore::initializePeerConnectionFactoryAndThreads):
2510         (WebCore::LibWebRTCProvider::setDecoderFactoryGetter):
2511         (WebCore::LibWebRTCProvider::setEncoderFactoryGetter):
2512         (WebCore::LibWebRTCProvider::setPeerConnectionFactory):
2513         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
2514
2515 2017-03-27  Brent Fulgham  <bfulgham@apple.com>
2516
2517         Only attach Attributes to a given element one time
2518         https://bugs.webkit.org/show_bug.cgi?id=170125
2519         <rdar://problem/31279676>
2520
2521         Reviewed by Chris Dumez.
2522
2523         Attach the attribute node to the Element before calling 'setAttributeInternal', since that method may cause
2524         arbitrary JavaScript events to fire. 
2525
2526         Test: fast/dom/Attr/only-attach-attr-once.html
2527
2528         * dom/Element.cpp:
2529         (WebCore::Element::attachAttributeNodeIfNeeded): Added.
2530         (WebCore::Element::setAttributeNode): Use new method. Revise to attach attribute before calling 'setAttributeInternal'. 
2531         (WebCore::Element::setAttributeNodeNS): Ditto.
2532         * dom/Element.h:
2533
2534 2017-03-28  Youenn Fablet  <youenn@apple.com>
2535
2536         Stop RTCDataChannel when closing page
2537         https://bugs.webkit.org/show_bug.cgi?id=170166
2538
2539         Reviewed by Eric Carlson.
2540
2541         Test: webrtc/datachannel/datachannel-gc.html
2542
2543         Making RTCDataChannel an ActiveDOMObject.
2544         Closing the data channel backend and freeing upon close and stop.
2545
2546         * Modules/mediastream/RTCDataChannel.cpp:
2547         (WebCore::RTCDataChannel::create):
2548         (WebCore::RTCDataChannel::RTCDataChannel):
2549         (WebCore::RTCDataChannel::close):
2550         (WebCore::RTCDataChannel::stop):
2551         * Modules/mediastream/RTCDataChannel.h:
2552         * Modules/mediastream/RTCDataChannel.idl:
2553         * Modules/mediastream/RTCPeerConnection.h:
2554
2555 2017-03-28  Myles C. Maxfield  <mmaxfield@apple.com>
2556
2557         Ranges for variation font properties are not enforced
2558         https://bugs.webkit.org/show_bug.cgi?id=169979
2559
2560         Reviewed by David Hyatt.
2561
2562         The spec specifies that:
2563         - Font weights less than or equal to 0, or greater than or equal to 1000 are parse errors
2564         - Font stretch values less than or equal to 0% are parse errors
2565         - Font style values less than or equal to -90deg or greater than or equal to 90deg are parse errors
2566
2567         Test: fast/text/variations/out-of-bounds-selection-properties.html
2568
2569         * css/parser/CSSPropertyParser.cpp:
2570         (WebCore::consumeFontWeightRange):
2571         (WebCore::fontStretchIsWithinRange):
2572         (WebCore::consumeFontStretch):
2573         (WebCore::consumeFontStretchRange):
2574         (WebCore::fontStyleIsWithinRange):
2575         (WebCore::consumeFontStyle):
2576         (WebCore::consumeFontStyleRange):
2577
2578 2017-03-28  Andy Estes  <aestes@apple.com>
2579
2580         [iOS] Crash in -[WebPreviewLoader failed] when running http/tests/multipart/policy-ignore-crash.php
2581         https://bugs.webkit.org/show_bug.cgi?id=170197
2582         <rdar://problem/30314067>
2583
2584         Reviewed by Brady Eidson.
2585
2586         If QuickLook conversion fails, we call ResourceLoader::didFail() with the NSError from
2587         QuickLook, which will call back into PreviewLoader::didFail(). We only care about network
2588         failures in PreviewLoader, not conversion failures, so check if
2589         m_finishedLoadingDataIntoConverter is set before continuing (like we do in
2590         PreviewLoader::didFinishLoading()).
2591
2592         Fixes crash in http/tests/multipart/policy-ignore-crash.php.
2593
2594         * loader/ios/PreviewLoader.mm:
2595         (WebCore::PreviewLoader::didFail):
2596
2597 2017-03-28  Chris Dumez  <cdumez@apple.com>
2598
2599         Audio indicator is visible on uni-watch.com but there is no audible audio
2600         https://bugs.webkit.org/show_bug.cgi?id=170200
2601         <rdar://problem/31289132>
2602
2603         Reviewed by Eric Carlson.
2604
2605         Cherry-pick the following patch from Blink by <rtoy@chromium.org>:
2606         - https://chromium.googlesource.com/chromium/src.git/+/439de5bb2a31384666db1a0e2dadb2b97d2f3ce4
2607
2608         When the gain of a GainNode is 0 or 1, the operation of the node can
2609         be optimized.  When gain = 1, just copy the input to the output.  When
2610         gain = 0; just zero out the output.  Currently, the input is
2611         multiplied by the gain to produce the output.  This just optimizes the
2612         multiplication away for the two special cases.
2613
2614         Also, have the GainNode set the silence hint if the gain is 0.
2615
2616         And fix a bug in processIfNecessary when unsilenceOutputs was causing the
2617         silence hint to be cleared after the node's process method was finished
2618         and may have set the silence hint.  The processing should come after
2619         unsilenceOutputs to preserve any hints from processing the node.
2620
2621         * Modules/webaudio/AudioNode.cpp:
2622         (WebCore::AudioNode::processIfNecessary):
2623         * Modules/webaudio/GainNode.cpp:
2624         (WebCore::GainNode::process):
2625         * platform/audio/AudioBus.cpp:
2626         (WebCore::AudioBus::copyWithGainFrom):
2627
2628 2017-03-28  Chris Dumez  <cdumez@apple.com>
2629
2630         Animated SVG images are not paused when outside viewport
2631         https://bugs.webkit.org/show_bug.cgi?id=170155
2632         <rdar://problem/31288893>
2633
2634         Reviewed by Antti Koivisto.
2635
2636         Make sure animated SVG images get paused when outside the viewport,
2637         similarly to what was already done for animated GIF images. Also
2638         make sure they are paused when they no longer have any renderers
2639         using them.
2640
2641         Tests: svg/animations/animated-svg-image-outside-viewport-paused.html
2642                svg/animations/animated-svg-image-removed-from-document-paused.html
2643
2644         * loader/cache/CachedImage.cpp:
2645         (WebCore::CachedImage::didAddClient):
2646         Restart the animation whenever a new CachedImage client is added. This
2647         will cause us the re-evaluate if the animation should run. The animation
2648         will pause again if the new renderer is not inside the viewport.
2649
2650         (WebCore::CachedImage::animationAdvanced):
2651         Add a flag to newImageAnimationFrameAvailable() so that the renderers can
2652         let us know if we can pause the animation. Pause the animation if all no
2653         renderer requires it (i.e. they are all outside the viewport, or there
2654         are no renderers).
2655
2656         * loader/cache/CachedImageClient.h:
2657         (WebCore::CachedImageClient::newImageAnimationFrameAvailable):
2658         By default, the CachedImageClients allow pausing. Only renderer will
2659         potentially prevent pausing if they are inside the viewport.
2660
2661         * platform/graphics/BitmapImage.cpp:
2662         (WebCore::BitmapImage::isAnimating):
2663         * platform/graphics/BitmapImage.h:
2664         * platform/graphics/Image.h:
2665         (WebCore::Image::isAnimating):
2666         Add isAnimating() flag on Image for layout testing purposes.
2667
2668         * rendering/RenderElement.cpp:
2669         (WebCore::RenderElement::newImageAnimationFrameAvailable):
2670         Set canPause flag to true if the renderer is not inside the viewport.
2671
2672         (WebCore::RenderElement::repaintForPausedImageAnimationsIfNeeded):
2673         Call startAnimation() if the renderer is now visible to resume SVG
2674         animations. Repainting is enough for GIF animations but not for SVG
2675         animations, we have to explicitly resume them.
2676
2677         * rendering/RenderElement.h:
2678         * rendering/RenderView.cpp:
2679         (WebCore::RenderView::addRendererWithPausedImageAnimations):
2680         (WebCore::RenderView::removeRendererWithPausedImageAnimations):
2681         (WebCore::RenderView::resumePausedImageAnimationsIfNeeded):
2682         * rendering/RenderView.h:
2683         Store CachedImages with the renderers that have paused animations.
2684         This is required for SVG where we need to explicitly resume the
2685         animation on the CachedImage when the renderer becomes visible
2686         again. Having access to the Image will also allow us to do smarter
2687         visibility checks in RenderElement's shouldRepaintForImageAnimation(),
2688         in the future.
2689
2690         * svg/SVGSVGElement.cpp:
2691         (WebCore::SVGSVGElement::hasActiveAnimation):
2692         * svg/SVGSVGElement.h:
2693         Add hasActiveAnimation() method.
2694
2695         * svg/graphics/SVGImage.cpp:
2696         (WebCore::SVGImage::startAnimation):
2697         Check that animations are paused before starting them. This avoid
2698         jumping due to unnecessary calls to rootElement->setCurrentTime(0).
2699
2700         (WebCore::SVGImage::isAnimating):
2701         Add isAnimating() method for layout tests purposes.
2702
2703         * svg/graphics/SVGImage.h:
2704         * svg/graphics/SVGImageClients.h:
2705         Call animationAdvanced() on the observer instead of the generic
2706         changedInRect() when the SVGImage is animating. This way, we go
2707         through the same code path as GIF animations and we end up calling
2708         CachedImage::animationAdvanced() which calls newImageAnimationFrameAvailable()
2709         on RenderElement, which determines if the animation should keep
2710         running or not.
2711
2712         * testing/Internals.cpp:
2713         (WebCore::Internals::isImageAnimating):
2714         * testing/Internals.h:
2715         * testing/Internals.idl:
2716         Add layout testing infrastructure.
2717
2718 2017-03-28  Antti Koivisto  <antti@apple.com>
2719
2720         Missing render tree position invalidation when tearing down renderers for display:contents subtree
2721         https://bugs.webkit.org/show_bug.cgi?id=170199
2722         <rdar://problem/31260856>
2723
2724         Reviewed by Zalan Bujtas.
2725
2726         Test: fast/shadow-dom/slot-renderer-teardown.html
2727
2728         * style/RenderTreeUpdater.cpp:
2729         (WebCore::RenderTreeUpdater::updateElementRenderer):
2730
2731             Invalidate the render tree position in case we do a teardown for an element without renderer.
2732
2733 2017-03-28  Ryan Haddad  <ryanhaddad@apple.com>
2734
2735         Unreviewed, rolling out r214485.
2736
2737         This change caused LayoutTest crashes.
2738
2739         Reverted changeset:
2740
2741         "Stop RTCDataChannel when closing page"
2742         https://bugs.webkit.org/show_bug.cgi?id=170166
2743         http://trac.webkit.org/changeset/214485
2744
2745 2017-03-28  Anders Carlsson  <andersca@apple.com>
2746
2747         ApplePayShippingContactUpdate.idl shouldn't have status field
2748         https://bugs.webkit.org/show_bug.cgi?id=170202
2749         rdar://problem/31307106
2750
2751         Reviewed by Beth Dakin.
2752
2753         * Modules/applepay/ApplePaySession.cpp:
2754         (WebCore::convertAndValidate):
2755         If status isn't set, infer it based on whether there are errors present or not.
2756
2757         * Modules/applepay/ApplePayShippingContactUpdate.h:
2758         Make status optional here; it's still used by the old code path.
2759
2760         * Modules/applepay/ApplePayShippingContactUpdate.idl:
2761         Remove status here.
2762
2763 2017-03-28  Brian Burg  <bburg@apple.com>
2764
2765         Web Inspector: Add "Disable Caches" option that only applies to the inspected page while Web Inspector is open
2766         https://bugs.webkit.org/show_bug.cgi?id=169865
2767         <rdar://problem/31250573>
2768
2769         Reviewed by Joseph Pecoraro.
2770
2771         Rewrite the network agent's command for disabling resource caching to use Page::setResourceCachingEnabled.
2772         The old implementation was doing weird stuff like setting no-cache headers and evicting the
2773         contents of the memory cache, neither of which is correct. The new approach has no side effects
2774         on the network, disk, or memory cache so it can be turned on temporarily without causing problems.
2775
2776         New tests:
2777         - http/tests/inspector/network/set-resource-caching-disabled-disk-cache.html
2778         - http/tests/inspector/network/set-resource-caching-disabled-memory-cache.html
2779
2780         * inspector/InspectorNetworkAgent.h:
2781         * inspector/InspectorNetworkAgent.cpp:
2782         (WebCore::InspectorNetworkAgent::setCacheDisabled): Deleted.
2783         (WebCore::InspectorNetworkAgent::setResourceCachingDisabled): Added.
2784         Implement new command.
2785
2786         (WebCore::InspectorNetworkAgent::willSendRequest):
2787         (WebCore::InspectorNetworkAgent::mainFrameNavigated):
2788         Remove crufty attempts to break caches. I believe these are intended to defeat caching
2789         proxies and similar middlemen, but this is just as likely to cause unusual loading behavior.
2790
2791         * page/Page.h:
2792         (WebCore::Page::isResourceCachingDisabled):
2793         (WebCore::Page::setResourceCachingDisabledOverride):
2794         Add an override setting so that Web Inspector's override does not mess up the value
2795         of isResourceCachingDisabled that may have been set by a WebKit API client.
2796
2797 2017-03-28  Youenn Fablet  <youenn@apple.com>
2798
2799         Fix addIceCandidate after r214441
2800         https://bugs.webkit.org/show_bug.cgi?id=170146
2801
2802         Reviewed by Chris Dumez.
2803
2804         Covered by rebased test.
2805
2806         * Modules/mediastream/RTCPeerConnection.js:
2807         (addIceCandidate): Setting function length to 1 and throwing if no parameter is passed.
2808
2809 2017-03-28  Youenn Fablet  <youenn@apple.com>
2810
2811         Stop RTCDataChannel when closing page
2812         https://bugs.webkit.org/show_bug.cgi?id=170166
2813
2814         Reviewed by Eric Carlson.
2815
2816         Test: webrtc/datachannel/datachannel-gc.html
2817
2818         Making RTCDataChannel an ActiveDOMObject.
2819         Closing the data channel backend and freeing upon close and stop.
2820
2821         * Modules/mediastream/RTCDataChannel.cpp:
2822         (WebCore::RTCDataChannel::create):
2823         (WebCore::RTCDataChannel::RTCDataChannel):
2824         (WebCore::RTCDataChannel::close):
2825         (WebCore::RTCDataChannel::stop):
2826         * Modules/mediastream/RTCDataChannel.h:
2827         * Modules/mediastream/RTCDataChannel.idl:
2828         * Modules/mediastream/RTCPeerConnection.h:
2829
2830 2017-03-27  Simon Fraser  <simon.fraser@apple.com>
2831
2832         Enhance the touch region debug overlay to show regions for the different events
2833         https://bugs.webkit.org/show_bug.cgi?id=170162
2834
2835         Reviewed by Tim Horton.
2836
2837         Have NonFastScrollableRegionOverlay use a different color for each region in EventTrackingRegions,
2838         and to draw a legend showing what the colors mean.
2839         
2840         On Mac, this overlay displays the non-fast scrollable region (which we don't keep separate from the wheel event
2841         region).
2842
2843         * page/DebugPageOverlays.cpp:
2844         (WebCore::NonFastScrollableRegionOverlay::updateRegion):
2845         (WebCore::touchEventRegionColors):
2846         (WebCore::drawRightAlignedText):
2847         (WebCore::NonFastScrollableRegionOverlay::drawRect):
2848         (WebCore::RegionOverlay::drawRect):
2849         (WebCore::RegionOverlay::drawRegion):
2850
2851 2017-03-27  Simon Fraser  <simon.fraser@apple.com>
2852
2853         Make sure the non-fast scrolling debug overlay is correctly updated
2854         https://bugs.webkit.org/show_bug.cgi?id=170142
2855
2856         Reviewed by Tim Horton.
2857
2858         AsyncScrollingCoordinator::frameViewEventTrackingRegionsChanged() is called on a timer
2859         from Document code, so the existing DebugPageOverlays::didLayout() call at the end
2860         of FrameView::layout() wasn't sufficient to keep the non-fast scrollable region up-to-date
2861         on iOS.
2862
2863         * page/scrolling/AsyncScrollingCoordinator.cpp:
2864         (WebCore::AsyncScrollingCoordinator::frameViewEventTrackingRegionsChanged):
2865
2866 2017-03-28  Antoine Quint  <graouts@apple.com>
2867
2868         [Modern Media Controls] AirPlay placard text looks bad on 1x displays
2869         https://bugs.webkit.org/show_bug.cgi?id=170183
2870         <rdar://problem/30663416>
2871
2872         Reviewed by Dean Jackson.
2873
2874         Use subpixel antialiasing for all text in modern media controls.
2875
2876         * Modules/modern-media-controls/controls/media-controls.css:
2877         (.media-controls-container,):
2878
2879 2017-03-28  Antoine Quint  <graouts@apple.com>
2880
2881         [Modern Media Controls] Improve appearance of tracks panel on macOS
2882         https://bugs.webkit.org/show_bug.cgi?id=168929
2883         <rdar://problem/30741589>
2884
2885         Reviewed by Eric Carlson.
2886
2887         We use a solid color for the focus state that matches the style used on macOS
2888         and blend the titles the same way we blend other non-solid labels in the controls bar.
2889
2890         * Modules/modern-media-controls/controls/tracks-panel.css:
2891         (.tracks-panel section):
2892         (.tracks-panel section > h3):
2893         (.tracks-panel section > ul > li:focus):
2894
2895 2017-03-28  Yoav Weiss  <yoav@yoav.ws>
2896
2897         Add a warning for unused link preloads.
2898         https://bugs.webkit.org/show_bug.cgi?id=165670
2899
2900         Reviewed by Youenn Fablet.
2901
2902         Tests: http/tests/preload/single_download_preload_headers_charset.php
2903                http/tests/preload/unused_preload_warning.html
2904
2905         * dom/Document.cpp:
2906         (WebCore::Document::prepareForDestruction): Stop the timer once the document is destructed.
2907         * loader/LinkPreloadResourceClients.h: Add shouldMarkAsReferenced overides for the LinkPreloadResourceClient classes.
2908         * loader/cache/CachedResource.cpp:
2909         (WebCore::CachedResource::addClientToSet): Make sure LinkPreloadResourceClients don't set resource to be referenced.
2910         * loader/cache/CachedResourceClient.h:
2911         (WebCore::CachedResourceClient::shouldMarkAsReferenced): Make sure that ResourceClients mark preloads as referenced by default.
2912         * loader/cache/CachedResourceLoader.cpp:
2913         (WebCore::CachedResourceLoader::CachedResourceLoader): Initialize timer.
2914         (WebCore::CachedResourceLoader::~CachedResourceLoader): Stop timer.
2915         (WebCore::CachedResourceLoader::documentDidFinishLoadEvent): Trigger a timer if preloads weren't cleared at load time.
2916         (WebCore::CachedResourceLoader::stopUnusedPreloadsTimer): Stop the timer.
2917         (WebCore::CachedResourceLoader::warnUnusedPreloads): Iterate over m_preloads and issue a warning for non-referenced preloads.
2918         * loader/cache/CachedResourceLoader.h:
2919         * page/DOMWindow.cpp:
2920         (WebCore::DOMWindow::willDetachDocumentFromFrame): Clear Resource Timing buffer when document detaches, to avoid test flakiness.
2921
2922 2017-03-28  Antoine Quint  <graouts@apple.com>
2923
2924         REGRESSION: Double-clicking the captions button while the captions popover is open prevents the popover from being opened again
2925         https://bugs.webkit.org/show_bug.cgi?id=170171
2926         <rdar://problem/31095500>
2927
2928         Reviewed by Dean Jackson.
2929
2930         We used to consider that the tracks panel was presented as long as it had a parent, but since we were using for the animated
2931         transition to complete before actually removing the panel from the node hierarchy, consecutive calls to hide then present
2932         would fail to present the panel. We now use a private instance variable to track the presented state which is set immediately
2933         as presentInParent() and hide() are called.
2934
2935         Test: media/modern-media-controls/tracks-support/tracks-support-show-panel-then-double-click-on-tracks-button.html
2936
2937         * Modules/modern-media-controls/controls/tracks-panel.js:
2938         (TracksPanel.prototype.get presented):
2939         (TracksPanel.prototype.presentInParent):
2940         (TracksPanel.prototype.hide):
2941
2942 2017-03-28  Aaron Chu  <aaron_chu@apple.com>
2943
2944         AX: Media controls should be able to be re-activated after faded away
2945         https://bugs.webkit.org/show_bug.cgi?id=170048
2946         <rdar://problem/30157179>
2947
2948         Reviewed by Antoine Quint.
2949
2950         Added a "foucsin" listener for the controls bar so that when an element
2951         within fires a "focusin" event, the controls bar reappears if it is faded.
2952
2953         Test: media/modern-media-controls/media-controls/media-controls-appear-when-focus.html
2954
2955         * Modules/modern-media-controls/controls/controls-bar.js:
2956         (ControlsBar.prototype.handleEvent):
2957
2958 2017-03-28  Antoine Quint  <graouts@apple.com>
2959
2960         [Modern Media Controls] Improve media documents across macOS, iPhone and iPad
2961         https://bugs.webkit.org/show_bug.cgi?id=169145
2962         <rdar://problem/17048858>
2963
2964         Reviewed by Dean Jackson.
2965
2966         There were a variety of issues with media documents, some longstanding, and some specifically
2967         about modern media controls.
2968
2969         One issue was that fullscreen and picture-in-picture buttons would show for audio media documents,
2970         due to using a <video> element to load the audio file. We now have additional logic in MediaController
2971         to identify if the loaded media is really an audio file, and using this information to hide the
2972         fullscreen and picture-in-picture buttons.
2973
2974         Another issue was that we would inject style in MediaDocument.cpp that was specific to modern media
2975         controls when we could have the modern-media-controls module injected CSS handle this styling. We now
2976         use the injected style in the shadow root to size media documents based on the device characteristics
2977         and ensuring that page styles are overridden.
2978
2979         We also simplify how MediaDocument.cpp sets the source of the media element to simply use the "src"
2980         attribute and not a <source> element.
2981
2982         Finally, we introduce a MediaDocumentController class that is instantiated when we're dealing with
2983         a media document to hide the controls while we determine the type of media we're loading (audio vs.
2984         video) in order to apply the appropriate styling without flashes.
2985
2986         As a result of the new styles applied by the modern-media-controls module, media documents have a
2987         similar behavior on macOS and iPad, where we only enforce a min-width for video allowing them
2988         to play at their natural size otherwise, and enforcing a fixed width for audio. On iPhone however,
2989         we want to always play the media at full width, with some padding in the case of audio.
2990
2991         Tests: media/modern-media-controls/fullscreen-support/fullscreen-support-disabled-video-with-audio-tracks-only.html
2992                media/modern-media-controls/media-documents/ipad/media-document-audio-ios-sizing.html
2993                media/modern-media-controls/media-documents/ipad/media-document-video-ios-sizing.html
2994                media/modern-media-controls/media-documents/media-document-audio-ios-sizing.html
2995                media/modern-media-controls/media-documents/media-document-audio-mac-sizing.html
2996                media/modern-media-controls/media-documents/media-document-video-ios-sizing.html
2997                media/modern-media-controls/media-documents/media-document-video-mac-sizing.html
2998                media/modern-media-controls/pip-support/pip-support-disabled-video-with-audio-tracks-only.html
2999
3000         * Modules/modern-media-controls/controls/ios-inline-media-controls.css:
3001         (:host(audio) .media-controls.ios.inline > .controls-bar:before,):
3002         (:host(audio) .media-controls.ios.inline > .controls-bar:before): Deleted.
3003         * Modules/modern-media-controls/controls/macos-media-controls.css:
3004         (:host(audio) .media-controls.mac.inline > .controls-bar,):
3005         (:host(audio) .media-controls.mac.inline > .controls-bar > .background-tint,):
3006         (:host(audio) .media-controls.mac.inline > .controls-bar): Deleted.
3007         (:host(audio) .media-controls.mac.inline > .controls-bar > .background-tint): Deleted.
3008         * Modules/modern-media-controls/controls/media-document.css: Copied from Source/WebCore/Modules/modern-media-controls/controls/macos-media-controls.css.
3009         (:host(.media-document)):
3010         (:host(.media-document.ready)):
3011         (:host(.media-document.audio.mac)):
3012         (:host(.media-document.audio.ipad)):
3013         (:host(.media-document.audio.iphone)):
3014         (:host(.media-document.video.mac)):
3015         (:host(.media-document.video.ipad)):
3016         (:host(.media-document.video.iphone)):
3017         * Modules/modern-media-controls/js-files:
3018         * Modules/modern-media-controls/media/fullscreen-support.js:
3019         (FullscreenSupport.prototype.syncControl):
3020         (FullscreenSupport):
3021         * Modules/modern-media-controls/media/media-controller.js:
3022         (MediaController):
3023         (MediaController.prototype.get isAudio):
3024         * Modules/modern-media-controls/media/media-document-controller.js: Copied from Source/WebCore/Modules/modern-media-controls/media/fullscreen-support.js.
3025         (MediaDocumentController):
3026         (MediaDocumentController.prototype.handleEvent):
3027         (MediaDocumentController.prototype._mediaDocumentHasMetadata):
3028         (MediaDocumentController.prototype._mediaDocumentHasSize):
3029         * Modules/modern-media-controls/media/pip-support.js:
3030         (PiPSupport.prototype.syncControl):
3031         (PiPSupport):
3032         * html/MediaDocument.cpp:
3033         (WebCore::MediaDocumentParser::createDocumentStructure):
3034
3035 2017-03-28  Myles C. Maxfield  <mmaxfield@apple.com>
3036
3037         Follow-up patch after r214364.
3038         https://bugs.webkit.org/show_bug.cgi?id=168895
3039
3040         Unreviewed.
3041
3042         * platform/graphics/FontDescription.cpp:
3043         (WebCore::FontDescription::FontDescription):
3044
3045 2017-03-27  Said Abou-Hallawa  <sabouhallawa@apple.com>
3046
3047         REGRESSION(213764): Large images should not be decoded asynchronously when they are drawn on a canvas
3048         https://bugs.webkit.org/show_bug.cgi?id=169771
3049
3050         Reviewed by Simon Fraser.
3051
3052         Sometimes we have to draw the image immediately like when a canvas calls  
3053         drawImage. In this case we have to decode the image synchronously to guarantee
3054         the drawing. Other times we need to decode with the native size of the image.
3055         The animated images have to be decoded with native size always. Otherwise
3056         the frame cache will be messed up if the same image is animated with different
3057         sizes. Currently we always decode asynchronously with sizeForDrawing. We need
3058         to decouple the decoding mode from the sizeForDrawing.
3059
3060         This patch introduce the DecodingOptions class which can store and compare the
3061         following four cases:
3062             -- Synchronous: The frame has be decoded with native size only.
3063             -- Asynchronous + anySize: This is passed from the Image::draw() callers.
3064             -- Asynchronous + fullSize: The image has to be decoded with its full size.
3065             -- Asynchronous + sizeForDrawing: The image can be decoded with sizeForDrawing unless
3066             it was decoded with either a full size or sizeForDrawing which is larger than the
3067             requested sizeForDrawing.
3068             
3069         A new argument of type DecodingMode will be added to Image::draw() function.
3070         Only when the drawing comes from the render tree, it will be Asynchronous.
3071         Otherwise it will be Synchronous.
3072
3073         Tests: fast/images/animated-image-different-dest-size.html
3074                fast/images/async-image-background-image.html
3075                fast/images/async-image-canvas-draw-image.html
3076
3077         * WebCore.xcodeproj/project.pbxproj:
3078         * platform/graphics/BitmapImage.cpp:
3079         (WebCore::BitmapImage::frameImageAtIndexCacheIfNeeded): Gets the frame image, cache it synchronously if
3080         the current one is invalid. frameImageAtIndex() returns whatever stored in the cache.
3081         (WebCore::BitmapImage::nativeImage): Call frameImageAtIndexCacheIfNeeded() instead of frameImageAtIndex().
3082         (WebCore::BitmapImage::nativeImageForCurrentFrame): Ditto.
3083         (WebCore::BitmapImage::nativeImageOfSize): Ditto.
3084         (WebCore::BitmapImage::framesNativeImages): Ditto.
3085         (WebCore::BitmapImage::draw): Change the logic to do the following:
3086         -- The animated image has to be decoded with its full size.
3087         -- The animated image expects the current frame to be ready for drawing.
3088         -- The large image decoding does not need to call internalStartAnimation().
3089         -- The large image has to request async image decoding but draw the current one if it exists.
3090         (WebCore::BitmapImage::drawPattern): Draw the pattern synchronously.
3091         (WebCore::BitmapImage::shouldUseAsyncDecodingForLargeImages): Delete the call to shouldUseAsyncDecodingForTesting()
3092         since it is only applied for animated images.
3093         (WebCore::BitmapImage::shouldUseAsyncDecodingForAnimatedImages): Call shouldUseAsyncDecodingForAnimatedImageForTesting().
3094         (WebCore::BitmapImage::internalStartAnimation): Request decoding with the full size.
3095         (WebCore::BitmapImage::advanceAnimation): Call shouldUseAsyncDecodingForAnimatedImageForTesting().
3096         (WebCore::BitmapImage::internalAdvanceAnimation): Assert the current frame is not being decoding asynchronously for any size.
3097         (WebCore::BitmapImage::frameImageAtIndex): Deleted. Moved to the header file but with a new purpose: return
3098         the current frame from the frame cache as is; do not cache a new one.
3099         (WebCore::BitmapImage::shouldUseAsyncDecodingForLargeImage): Deleted. Function was renamed to shouldUseAsyncDecodingForLargeImages.
3100         (WebCore::BitmapImage::shouldUseAsyncDecodingForAnimatedImage): Deleted. Function was renamed to shouldUseAsyncDecodingForAnimatedImages.
3101         * platform/graphics/BitmapImage.h:
3102         * platform/graphics/CrossfadeGeneratedImage.cpp:
3103         (WebCore::CrossfadeGeneratedImage::draw): Add a new argument of type DecodingMode.
3104         * platform/graphics/CrossfadeGeneratedImage.h:
3105         * platform/graphics/DecodingOptions.h: Added.
3106         (WebCore::DecodingOptions::DecodingOptions): Default constructor: Synchronous mode.
3107         (WebCore::DecodingOptions::operator==): Compares two DecodingOptions for equality.
3108         (WebCore::DecodingOptions::isSynchronous): Is the frame decoded synchronously?
3109         (WebCore::DecodingOptions::isAsynchronous): Is the frame decoded asynchronously?
3110         (WebCore::DecodingOptions::isAsynchronousCompatibleWith): Is this DecodingOptions compatible with another one?
3111         (WebCore::DecodingOptions::hasFullSize): Is the decoding mode asynchronous but for the image full size?
3112         (WebCore::DecodingOptions::hasSizeForDrawing): Is this decoding mode asynchronous but for a sizeForDrawing?
3113         (WebCore::DecodingOptions::sizeForDrawing): Returns the sizeForDrawing. m_decodingModeOrSize has to hold an IntSize.
3114         (WebCore::DecodingOptions::maxDimension): Moved form ImageFrame.cpp.
3115         (WebCore::DecodingOptions::has): A helper function.
3116         (WebCore::DecodingOptions::hasDecodingMode): Does m_decodingModeOrSize a DecodingMode?
3117         (WebCore::DecodingOptions::hasSize): Does m_decodingModeOrSize an IntSize?
3118         * platform/graphics/GeneratedImage.h: Add a new argument of type DecodingMode.
3119         * platform/graphics/GradientImage.cpp:
3120         (WebCore::GradientImage::draw): Ditto.
3121         * platform/graphics/GradientImage.h: Ditto.
3122         * platform/graphics/GraphicsContext.cpp:
3123         (WebCore::GraphicsContext::drawImage): Pass the ImagePaintingOptions::m_DecodingMode to Image::draw().
3124         * platform/graphics/GraphicsContext.h:
3125         (WebCore::ImagePaintingOptions::ImagePaintingOptions): Add a new member of type DecodingMode to ImagePaintingOptions.
3126         * platform/graphics/Image.cpp:
3127         (WebCore::Image::drawTiled): Pass DecodingMode::Synchronous to Image::draw().
3128         * platform/graphics/Image.h: Add a new argument of type DecodingMode to Image::draw().
3129         * platform/graphics/ImageFrame.cpp:
3130         (WebCore::ImageFrame::operator=): Replace m_sizeForDrawing by m_decodingOptions.
3131         (WebCore::ImageFrame::hasNativeImage): Check if m_nativeImage is valid and the subsamplingLevels match.
3132         (WebCore::ImageFrame::hasFullSizeNativeImage): Checks hasNativeImage() and whether the image frame was
3133         decoded for the image full size.
3134         (WebCore::ImageFrame::hasDecodedNativeImageCompatibleWithOptions): Checks hasNativeImage() and the DecodingOptions match.
3135         (WebCore::maxDimension): Deleted. Moved to DecodingOptions.h.
3136         (WebCore::ImageFrame::isBeingDecoded): Deleted. The check for having an ImageFrame being decoded is
3137         moved to ImageFrameCache.
3138         (WebCore::ImageFrame::hasValidNativeImage): Deleted. No need to this function.
3139         * platform/graphics/ImageFrame.h:
3140         (WebCore::ImageFrame::hasNativeImage): Add an std::optional<SubsamplingLevel> argument.
3141         (WebCore::ImageFrame::hasFullSizeNativeImage): Checks whether the ImageFrame was decoded for the image full size.
3142         (WebCore::ImageFrame::enqueueSizeForDecoding): Deleted.
3143         (WebCore::ImageFrame::dequeueSizeForDecoding): Deleted.
3144         (WebCore::ImageFrame::clearSizeForDecoding): Deleted.
3145         (WebCore::ImageFrame::isBeingDecoded): Deleted.
3146         (WebCore::ImageFrame::sizeForDrawing): Deleted.
3147         (WebCore::ImageFrame::hasDecodedNativeImage): Deleted.
3148         The logic of knowing whether an ImageFrame is being decoded is moved to ImageFrameCache.
3149         * platform/graphics/ImageFrameCache.cpp:
3150         (WebCore::ImageFrameCache::cacheFrameMetadataAtIndex): Caches the metadata of an ImageFrame. If the NativeImage
3151         was decoded for a sizeForDrawing, the size of the ImageFrame will be the nativeImageSize(). Otherwise, the
3152         frameSizeAtIndex() will be called.
3153         (WebCore::ImageFrameCache::cacheFrameNativeImageAtIndex): Cache a new NativeImage which involves caching new
3154         metadata and updating the memory cache. No need to check if the existing native image is valid or not for the
3155         DecodingOptions. Actually it would be a bug if it happens. This is why cacheNativeImageForFrameRequest() asserts
3156         !frame.hasAsyncNativeImage() before calling cacheFrameNativeImageAtIndex().
3157         (WebCore::ImageFrameCache::cacheAsyncFrameNativeImageAtIndex): Cache new NativeImage which was decoded asynchronously.
3158         (WebCore::ImageFrameCache::startAsyncDecodingQueue): Call cacheAsyncFrameNativeImageAtIndex() instead of
3159         cacheNativeImageForFrameRequest() for clarity.
3160         (WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex): Call hasAsyncNativeImage() instead of hasValidNativeImage()
3161         Call frameIsDecodingCompatibleWithOptionsAtIndex() instead of frame.isBeingDecoded(). Replace the call to enqueueSizeForDecoding()
3162         by appending the same ImageFrameRequest to m_frameCommitQueue.
3163         (WebCore::ImageFrameCache::isAsyncDecodingQueueIdle): Use m_frameCommitQueue to answer the question whether the decodingQueue is idle.
3164         (WebCore::ImageFrameCache::stopAsyncDecodingQueue): Use m_frameCommitQueue to loop through all the ImageFrames which are currently being decoded.
3165         (WebCore::ImageFrameCache::frameAtIndexCacheIfNeeded): For getting the metadata, this function needs a valid frame. If it is requested
3166         to decode the nativeImage, it has to do it synchronously.
3167         (WebCore::ImageFrameCache::singlePixelSolidColor): Don't cache the frame if it is an animated image or the size is not a single pixel.
3168         (WebCore::ImageFrameCache::frameIsBeingDecodedAndIsCompatibleWithOptionsAtIndex): Use m_frameCommitQueue to answer the question whether an ImageFrame
3169         is being decoded and is compatible with DecodingOptions.
3170         (WebCore::ImageFrameCache::frameHasFullSizeNativeImageAtIndex): Calls ImageFrame::hasFullNativeImage() for a frame. 
3171         (WebCore::ImageFrameCache::frameHasDecodedNativeImageCompatibleWithOptionsAtIndex): Calls ImageFrame::hasDecodedNativeImageCompatibleWithOptions() for a frame.
3172         (WebCore::ImageFrameCache::frameImageAtIndex): Returns the current NativeImage without caching.
3173         (WebCore::ImageFrameCache::frameImageAtIndexCacheIfNeeded): Returns the current NativeImage but cache it synchronously if needed.
3174         (WebCore::ImageFrameCache::setFrameNativeImageAtIndex): Deleted.
3175         (WebCore::ImageFrameCache::setFrameMetadataAtIndex): Deleted.
3176         (WebCore::ImageFrameCache::replaceFrameNativeImageAtIndex): Deleted.
3177         (WebCore::ImageFrameCache::frameIsBeingDecodedAtIndex): Deleted.
3178         (WebCore::ImageFrameCache::frameHasImageAtIndex): Deleted.
3179         (WebCore::ImageFrameCache::frameHasValidNativeImageAtIndex): Deleted.
3180         (WebCore::ImageFrameCache::frameHasDecodedNativeImage): Deleted.
3181         * platform/graphics/ImageFrameCache.h: Two ImageFrameRequest queues will be used.
3182         -- The existing one m_frameRequestQueue which is shared between the main thread and decoding thread. The requests will be
3183         dequeued from it before starting the decoding. The decoded NativeImage will be cached only on the main thread. The decoding
3184         thread is not blocked by the callOnMainThread(). This means there might be multiple ImageFrameRequests which were dequeued
3185         while their NativeImages have not been cached yet.
3186         -- A new one m_frameCommitQueue which is track all the ImageFrameRequests whose NativeImages have not been cached yet.
3187         (WebCore::ImageFrameCache::frameAtIndexCacheIfNeeded): Be explicit about caching the image frame. frameImageAtIndex()
3188         returns the current image frame without caching. frameAtIndexCacheIfNeeded(). returns the current image frame but cache
3189         it if needed.
3190         (WebCore::ImageFrameCache::ImageFrameRequest::operator==): Compares two ImageFrameRequests for equality.
3191         * platform/graphics/ImageSource.cpp:
3192         (WebCore::ImageSource::frameImageAtIndexCacheIfNeeded): 
3193         (WebCore::ImageSource::frameImageAtIndex): Deleted.
3194         * platform/graphics/ImageSource.h:
3195         (WebCore::ImageSource::requestFrameAsyncDecodingAtIndex): Change the type of the argument from IntSize to be const std::optional<IntSize>.
3196         (WebCore::ImageSource::frameIsBeingDecodedAndIsCompatibleWithOptionsAtIndex): Rename of frameIsBeingDecodedAtIndex(). Replace the argument of type
3197         std::optional<IntSize> by an argument of type DecodingOptions.
3198         (WebCore::ImageSource::frameHasFullSizeNativeImageAtIndex): A wrapper around the ImageFrameCache function.
3199         (WebCore::ImageSource::frameHasDecodedNativeImageCompatibleWithOptionsAtIndex): Ditto.
3200         (WebCore::ImageSource::frameImageAtIndex): Ditto.
3201         (WebCore::ImageSource::frameIsBeingDecodedAtIndex): Deleted.
3202         (WebCore::ImageSource::frameHasValidNativeImageAtIndex): Deleted.
3203         (WebCore::ImageSource::frameHasDecodedNativeImage): Deleted.
3204         * platform/graphics/NamedImageGeneratedImage.cpp:
3205         (WebCore::NamedImageGeneratedImage::draw): Add a new argument of type DecodingMode.
3206         * platform/graphics/NamedImageGeneratedImage.h: Ditto.
3207         * platform/graphics/cairo/ImageBufferCairo.cpp:
3208         (WebCore::ImageBuffer::draw): Add a new argument of type DecodingMode.
3209         * platform/graphics/cg/ImageDecoderCG.cpp:
3210         (WebCore::ImageDecoder::createFrameImageAtIndex): Replace the sizeForDrawing argument by a DecodingMode argument. Add a new handling
3211         for decoding asynchronously for the image full size.
3212         * platform/graphics/cg/ImageDecoderCG.h: Change the prototype of the function.
3213         * platform/graphics/cg/PDFDocumentImage.cpp:
3214         (WebCore::PDFDocumentImage::draw): Add a new argument of type DecodingMode.
3215         * platform/graphics/cg/PDFDocumentImage.h:
3216         * platform/graphics/win/ImageCGWin.cpp:
3217         (WebCore::BitmapImage::getHBITMAPOfSize): Pass DecodingMode::Synchronous to Image::draw().
3218         (WebCore::BitmapImage::drawFrameMatchingSourceSize): Ditto.
3219         * platform/graphics/win/ImageDecoderDirect2D.cpp:
3220         (WebCore::ImageDecoder::createFrameImageAtIndex): Replace the sizeForDrawing argument by a DecodingMode argument.
3221         * platform/graphics/win/ImageDecoderDirect2D.h: Change the prototype of the function.
3222         * platform/image-decoders/ImageDecoder.cpp: 
3223         (WebCore::ImageDecoder::createFrameImageAtIndex): Replace the sizeForDrawing argument by a DecodingMode argument.
3224         * platform/image-decoders/ImageDecoder.h: Change the prototype of the function.
3225         * rendering/RenderBoxModelObject.cpp:
3226         (WebCore::RenderBoxModelObject::paintFillLayerExtended): Draw the background image asynchronously if the image size is large.
3227         * rendering/RenderImage.cpp:
3228         (WebCore::RenderImage::paintIntoRect): Draw the background image element asynchronously if the image size is large.
3229         * svg/graphics/SVGImage.cpp:
3230         (WebCore::SVGImage::drawForContainer): Pass DecodingMode::Synchronous to draw().
3231         (WebCore::SVGImage::nativeImageForCurrentFrame): Ditto.
3232         (WebCore::SVGImage::nativeImage): Ditto.
3233         (WebCore::SVGImage::draw): Add a new argument of type DecodingMode.
3234         * svg/graphics/SVGImage.h: Change the prototype of the function.
3235         * svg/graphics/SVGImageForContainer.cpp:
3236         (WebCore::SVGImageForContainer::draw): Add a new argument of type DecodingMode.
3237         * svg/graphics/SVGImageForContainer.h: Change the prototype of the function.
3238
3239 2017-03-27  Youenn Fablet  <youenn@apple.com>
3240
3241         Activate release libwebrtc logging when WebRTC log channel is on
3242         https://bugs.webkit.org/show_bug.cgi?id=169659
3243
3244         Reviewed by Alex Christensen.
3245
3246         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
3247         (WebCore::initializePeerConnectionFactoryAndThreads):
3248
3249 2017-03-27  Antti Koivisto  <antti@apple.com>
3250
3251         Move visibleInViewportStateChanged callback from Element to render tree
3252         https://bugs.webkit.org/show_bug.cgi?id=170039
3253
3254         Reviewed by Zalan Bujtas.
3255
3256         Make it easier to use from the render tree.
3257
3258         Also for simplicity move the bits from RenderObject rare data to RenderElement.
3259         There is plenty of space there.
3260
3261         * dom/Element.h:
3262         (WebCore::Element::isVisibleInViewportChanged): Deleted.
3263         * html/HTMLMediaElement.h:
3264         * rendering/RenderElement.cpp:
3265         (WebCore::RenderElement::RenderElement):
3266         (WebCore::RenderElement::willBeDestroyed):
3267         (WebCore::RenderElement::registerForVisibleInViewportCallback):
3268         (WebCore::RenderElement::unregisterForVisibleInViewportCallback):
3269         (WebCore::RenderElement::setVisibleInViewportState):
3270         (WebCore::RenderElement::visibleInViewportStateChanged):
3271         * rendering/RenderElement.h:
3272         (WebCore::RenderElement::visibleInViewportState):
3273         * rendering/RenderObject.cpp:
3274         (WebCore::RenderObject::setIsRegisteredForVisibleInViewportCallback): Deleted.
3275         (WebCore::RenderObject::setVisibleInViewportState): Deleted.
3276         * rendering/RenderObject.h:
3277         (WebCore::RenderObject::hasOutlineAutoAncestor):
3278         (WebCore::RenderObject::RenderObjectRareData::RenderObjectRareData):
3279         (WebCore::RenderObject::isRegisteredForVisibleInViewportCallback): Deleted.
3280         (WebCore::RenderObject::visibleInViewportState): Deleted.
3281         * rendering/RenderVideo.cpp:
3282         (WebCore::RenderVideo::visibleInViewportStateChanged):
3283         * rendering/RenderVideo.h:
3284         * rendering/RenderView.cpp:
3285         (WebCore::RenderView::updateVisibleViewportRect):
3286
3287 2017-03-27  Youenn Fablet  <youenn@apple.com>
3288
3289         addIceCandidate should not throw if passed null or undefined
3290         https://bugs.webkit.org/show_bug.cgi?id=170118
3291
3292         Reviewed by Eric Carlson.
3293
3294         Covered by updated test.
3295
3296         A null/undefined candidate passed to addIceCandidate means end of Ice candidate..
3297
3298         * Modules/mediastream/PeerConnectionBackend.cpp:
3299         (WebCore::PeerConnectionBackend::addIceCandidate):
3300         * Modules/mediastream/PeerConnectionBackend.h:
3301         (WebCore::PeerConnectionBackend::endOfIceCandidates):
3302         * Modules/mediastream/RTCPeerConnection.cpp:
3303         (WebCore::RTCPeerConnection::queuedAddIceCandidate):
3304         * Modules/mediastream/RTCPeerConnection.h:
3305         * Modules/mediastream/RTCPeerConnection.idl:
3306         * Modules/mediastream/RTCPeerConnection.js:
3307         (addIceCandidate):
3308
3309 2017-03-27  Antti Koivisto  <antti@apple.com>
3310
3311         Allow the page to render before <link> stylesheet tags in body
3312         https://bugs.webkit.org/show_bug.cgi?id=149157
3313         <rdar://problem/24658830>
3314
3315         Reviewed by Simon Fraser.
3316
3317         Currently we block style and renderer building completely if document has any loading
3318         stylesheets. In case a script queries something layout dependent we construct the render
3319         tree with whatever style we have but block painting in it.
3320
3321         This patch changes behavior so that a loading stylesheet in body only blocks rendering for elements
3322         that are after it. The expectation is that such stylesheets rarely affect elements before them
3323         and the elements can be rendered without causing ugly visible styling changes.
3324
3325         The patch replaces the old flash-of-unstyled-content (FOUC) preventation mechanism with a more
3326         fine-grained one. Paint blocking is now done on per-renderer basis with based on isNonFinal flag in
3327         RenderStyle.
3328
3329         For stylesheets in head the behavior should be largely unchanged.
3330
3331         Test: http/tests/incremental/stylesheet-body-incremental-rendering.html
3332
3333         * css/StyleResolver.cpp:
3334         (WebCore::StyleResolver::pseudoStyleRulesForElement):
3335         * dom/Document.cpp:
3336         (WebCore::Document::Document):
3337         (WebCore::Document::resolveStyle):
3338         (WebCore::Document::updateLayoutIgnorePendingStylesheets):
3339
3340             Remove the old FOUC preventation state tracking.
3341
3342         (WebCore::Document::shouldScheduleLayout):
3343         (WebCore::Document::didRemoveAllPendingStylesheet):
3344
3345             Repaints will now get triggered by the normal style mechanism.
3346
3347         * dom/Document.h:
3348         (WebCore::Document::hasNodesWithNonFinalStyle):
3349         (WebCore::Document::setHasNodesWithNonFinalStyle):
3350
3351             Track if we need to recompute the style later because non-final or unstyled elements.
3352
3353         (WebCore::Document::didLayoutWithPendingStylesheets): Deleted.
3354         (WebCore::Document::hasNodesWithPlaceholderStyle): Deleted.
3355         (WebCore::Document::setHasNodesWithPlaceholderStyle): Deleted.
3356         * html/HTMLFrameSetElement.cpp:
3357         (WebCore::HTMLFrameSetElement::rendererIsNeeded):
3358         * page/FrameView.cpp:
3359         (WebCore::FrameView::qualifiesAsVisuallyNonEmpty):
3360
3361             Don't qualify as visually non-empty if we have loading stylesheets in head (even if there is
3362             a fouc-prevented render tree).
3363
3364         (WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
3365         * rendering/RenderBlock.cpp:
3366         (WebCore::RenderBlock::paintContents):
3367
3368             Instead of a global test, block painting if isNonFinal is set in the renderer's style.
3369
3370         * rendering/RenderLayer.cpp:
3371         (WebCore::shouldSuppressPaintingLayer):
3372         * rendering/style/RenderStyle.cpp:
3373         (WebCore::RenderStyle::changeRequiresRepaint):
3374
3375             The isNonFinal flag prevents painting so we need to trigger repaint when it gets cleared.
3376
3377         * rendering/style/RenderStyle.h:
3378         (WebCore::RenderStyle::isNotFinal):
3379         (WebCore::RenderStyle::setIsNotFinal):
3380         (WebCore::RenderStyle::isPlaceholderStyle): Deleted.
3381         (WebCore::RenderStyle::setIsPlaceholderStyle): Deleted.
3382
3383             There is no need for placeholder styles anymore. Reuse the bit for isNotFinal.
3384
3385         * rendering/style/StyleRareNonInheritedData.cpp:
3386         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
3387         (WebCore::StyleRareNonInheritedData::operator==):
3388         * rendering/style/StyleRareNonInheritedData.h:
3389         * style/StyleScope.cpp:
3390         (WebCore::Style::Scope::analyzeStyleSheetChange):
3391         (WebCore::Style::Scope::updateActiveStyleSheets):
3392         * style/StyleTreeResolver.cpp:
3393         (WebCore::Style::TreeResolver::styleForElement):
3394         (WebCore::Style::TreeResolver::resolveElement):
3395
3396             If we have seens a loading stylesheet and don't have a renderer yet don't style the element.
3397             In case there is a renderer or we are ignoring pending sheets, resolve the style normally
3398             but mark it as non-final.
3399
3400         (WebCore::Style::makePlaceholderStyle): Deleted.
3401
3402 2017-03-27  Myles C. Maxfield  <mmaxfield@apple.com>
3403
3404         Test variation font ranges in the CSS Font Loading API
3405         https://bugs.webkit.org/show_bug.cgi?id=170022
3406
3407         Reviewed by Dean Jackson.
3408
3409         Test: fast/text/variations/font-loading-api-parse-ranges.html
3410
3411         Don't use keywords when reporting font variation range values.
3412
<