1f313b77320130b7685af2b09ce922f8a484edce
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-06-13  Brady Eidson  <beidson@apple.com>
2
3         Crashes in WebCore::IDBServer::UniqueIDBDatabase::executeNextDatabaseTask.
4         <rdar://problem/26768449> and https://bugs.webkit.org/show_bug.cgi?id=158696
5
6         Reviewed by David Kilzer.
7
8         No new tests (Covered by all existing tests in Gmalloc/ASAN configs).
9
10         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
11         (WebCore::IDBServer::UniqueIDBDatabase::executeNextDatabaseTask):
12         (WebCore::IDBServer::UniqueIDBDatabase::executeNextDatabaseTaskReply):
13
14 2016-06-13  Brady Eidson  <beidson@apple.com>
15
16         Modern IDB: IDBOpenDBRequest objects leak.
17         https://bugs.webkit.org/show_bug.cgi?id=158694
18
19         Reviewed by Alex Christensen.
20
21         No new tests (Currently have no testing strategy for guaranteeing lifetime of WebCore DOM objects)
22
23         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
24         (WebCore::IDBClient::IDBConnectionProxy::completeOpenDBRequest): At this point we never need the
25             request again, so remove it from the map.
26
27 2016-06-13  Chris Dumez  <cdumez@apple.com>
28
29         Make sure HTTPHeaderMap gets a move constructor / assignment operator
30         https://bugs.webkit.org/show_bug.cgi?id=158695
31         <rdar://problem/26729511>
32
33         Reviewed by Alex Christensen.
34
35         Make sure HTTPHeaderMap gets a move constructor / assignment operator.
36         It was not getting an implicit one because of its user-declared
37         destructor. This patch drops the user-declared destructor so that
38         HTTPHeaderMap now gets an implicit move constructor / assignment
39         operator.
40
41         Not having a move constructor / assignment operator is an issue because
42         we rely on HTTPHeaderMap::isolatedCopy() / WTFMove() since r201623 to
43         pass HTTPHeaderMap across thread.
44
45         * platform/network/HTTPHeaderMap.cpp:
46         (WebCore::HTTPHeaderMap::~HTTPHeaderMap): Deleted.
47         * platform/network/HTTPHeaderMap.h:
48
49 2016-06-13  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
50
51         Remove useless parameter from GenerateParametersCheck signature
52         https://bugs.webkit.org/show_bug.cgi?id=158692
53
54         Reviewed by Chris Dumez.
55
56         Remove one parameter which is passed to GenerateParametersCheck
57         but never used in the caller code.
58
59         * bindings/scripts/CodeGeneratorJS.pm:
60         (GenerateImplementation):
61         (GenerateParametersCheck):
62         (GenerateConstructorDefinition):
63
64 2016-06-13  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
65
66         Improve code generator for functions with variadic parameters
67         https://bugs.webkit.org/show_bug.cgi?id=158529
68
69         Reviewed by Darin Adler.
70
71         JS bindings code of functions with variadic parameters is improved.
72
73         Functions with variadic parameters are skipped for ObjC and GObject code generators.
74
75         * bindings/scripts/CodeGeneratorGObject.pm:
76         (SkipFunction): Skip functions with variadic parameters.
77         * bindings/scripts/CodeGeneratorJS.pm:
78         (GenerateParametersCheck):
79         * bindings/scripts/CodeGeneratorObjC.pm:
80         (SkipFunction): Skip functions with variadic parameters.
81         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
82         (webkit_dom_test_obj_any): Deleted.
83         (webkit_dom_test_obj_attach_shadow_root): Deleted.
84         (webkit_dom_test_obj_get_read_only_long_attr): Deleted.
85         (webkit_dom_test_obj_get_read_only_string_attr): Deleted.
86         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
87         * bindings/scripts/test/JS/JSTestObj.cpp:
88         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod12):
89         (WebCore::jsTestObjPrototypeFunctionVariadicStringMethod):
90         (WebCore::jsTestObjPrototypeFunctionVariadicDoubleMethod):
91         (WebCore::jsTestObjPrototypeFunctionVariadicNodeMethod):
92         * bindings/scripts/test/ObjC/DOMTestObj.h:
93         * bindings/scripts/test/ObjC/DOMTestObj.mm:
94
95 2016-06-12  Zalan Bujtas  <zalan@apple.com>
96
97         Cleanup RenderBlock::removePositionedObjects
98         https://bugs.webkit.org/show_bug.cgi?id=158670
99
100         Reviewed by Simon Fraser.
101
102         No change in functionality.
103
104         * rendering/RenderBlock.cpp:
105         (WebCore::RenderBlock::insertPositionedObject):
106         (WebCore::RenderBlock::removePositionedObject):
107         (WebCore::RenderBlock::removePositionedObjects):
108         * rendering/RenderBlock.h:
109
110 2016-06-12  Zalan Bujtas  <zalan@apple.com>
111
112         Remove positioned descendants when RenderBlock is no longer a containing block.
113         https://bugs.webkit.org/show_bug.cgi?id=158655
114         <rdar://problem/26510032>
115
116         Reviewed by Simon Fraser.
117
118         Normally the RenderView is the containing block for fixed positioned renderers.
119         However when a renderer acquires some transform related properties, it becomes the containing
120         block for all the fixed positioned renderers in its descendant tree.
121         When the last transform related property is removed, the renderer is no longer a containing block
122         and we need to remove all these positioned renderers from the descendant tracker map (gPositionedDescendantsMap).
123         They will be inserted back into the tracker map during the next layout (either under the RenderView or
124         under the next transformed renderer in the ancestor chain).
125
126         Test: fast/block/fixed-position-reparent-when-transition-is-removed.html
127
128         * rendering/RenderBlock.cpp:
129         (WebCore::RenderBlock::removePositionedObjectsIfNeeded):
130
131 2016-06-11  Myles C. Maxfield  <mmaxfield@apple.com>
132
133         Addressing post-review comments after r201978.
134         https://bugs.webkit.org/show_bug.cgi?id=158649
135         <rdar://problem/13258122>
136
137         Unreviewed.
138
139         * platform/graphics/FontCache.cpp:
140         (WebCore::FontCache::alternateFamilyName):
141         * platform/graphics/cocoa/FontCacheCoreText.cpp:
142         (WebCore::FontCache::platformAlternateFamilyName):
143
144 2016-06-11  Darin Adler  <darin@apple.com>
145
146         Tighten code to build set of tag names
147         https://bugs.webkit.org/show_bug.cgi?id=158662
148
149         Reviewed by Alexey Proskuryakov.
150
151         * dom/Element.cpp:
152         (WebCore::canAttachAuthorShadowRoot): Use an array of pointers that the loader
153         can initialize as part of loading the library, rather than an array that needs
154         to be initialized with code at runtime.
155
156 2016-06-11  Myles C. Maxfield  <mmaxfield@apple.com>
157
158         [Win] [EFL] Build fix after r201978.
159         https://bugs.webkit.org/show_bug.cgi?id=158649
160         <rdar://problem/13258122>
161
162         Unreviewed
163
164         * platform/graphics/freetype/FontCacheFreeType.cpp:
165         (WebCore::FontCache::platformAlternateFamilyName):
166         * platform/graphics/win/FontCacheWin.cpp:
167
168 2016-06-11  Myles C. Maxfield  <mmaxfield@apple.com>
169
170         [Cocoa] Map commonly used Chinese Windows font names to names present on Cocoa operating systems
171         https://bugs.webkit.org/show_bug.cgi?id=158649
172         <rdar://problem/13258122>
173
174         Reviewed by Darin Adler.
175
176         There are many Chinese websites which hardcode Windows font names.
177         We should map these to fonts which best match them on Cocoa operating
178         systems. We can do this by using our existing fallback font name
179         infrastructure.
180
181         Tests: fast/text/chinese-font-name-aliases-2.html
182                fast/text/chinese-font-name-aliases.html
183
184         * platform/graphics/FontCache.cpp:
185         (WebCore::FontCache::alternateFamilyName):
186         (WebCore::alternateFamilyName): Deleted.
187         * platform/graphics/FontCache.h:
188         * platform/graphics/cocoa/FontCacheCoreText.cpp:
189         (WebCore::FontCache::platformAlternateFamilyName):
190         * platform/graphics/freetype/FontCacheFreeType.cpp:
191         (WebCore::FontCache::platformAlternateFamilyName):
192         * platform/graphics/win/FontCacheWin.cpp:
193         (WebCore::FontCache::platformAlternateFamilyName):
194
195 2016-06-11  Commit Queue  <commit-queue@webkit.org>
196
197         Unreviewed, rolling out r201967, r201968, and r201972.
198         https://bugs.webkit.org/show_bug.cgi?id=158665
199
200         Caused flaky failures on IndexedDB tests (Requested by ap on
201         #webkit).
202
203         Reverted changesets:
204
205         "Vary:Cookie validation doesn't work in private browsing"
206         https://bugs.webkit.org/show_bug.cgi?id=158616
207         http://trac.webkit.org/changeset/201967
208
209         "Build fix."
210         http://trac.webkit.org/changeset/201968
211
212         "WinCairo build fix attempt."
213         http://trac.webkit.org/changeset/201972
214
215 2016-06-11  Konstantin Tokarev  <annulen@yandex.ru>
216
217         Fixed compilation of LocaleICU with ENABLE(DATE_AND_TIME_INPUT_TYPES)
218         https://bugs.webkit.org/show_bug.cgi?id=158659
219
220         Reviewed by Darin Adler.
221
222         No new tests needed.
223
224         * platform/text/LocaleICU.cpp:
225         (WebCore::getFormatForSkeleton):
226         (WebCore::LocaleICU::monthFormat):
227         (WebCore::LocaleICU::shortMonthFormat):
228
229 2016-06-11  Antti Koivisto  <antti@apple.com>
230
231         WinCairo build fix attempt.
232
233         * platform/network/NetworkStorageSession.cpp:
234         * platform/network/NetworkStorageSession.h:
235         * platform/network/NetworkStorageSessionStub.cpp:
236         (WebCore::NetworkStorageSession::NetworkStorageSession):
237         (WebCore::NetworkStorageSession::context):
238         (WebCore::NetworkStorageSession::createPrivateBrowsingSession):
239         (WebCore::NetworkStorageSession::switchToNewTestingSession):
240         (WebCore::NetworkStorageSession::~NetworkStorageSession): Deleted.
241         (WebCore::defaultSession): Deleted.
242         (WebCore::NetworkStorageSession::defaultStorageSession): Deleted.
243
244 2016-06-11  Myles C. Maxfield  <mmaxfield@apple.com>
245
246         Deleting a CSSOM style rule invalidates any previously-added FontFaces
247         https://bugs.webkit.org/show_bug.cgi?id=158450
248
249         Reviewed by Darin Adler.
250
251         This patch has two pieces: updating the CSSOM when the FontFace changes, and
252         updating the FontFace when the CSSOM changes.
253
254         1: Updating the CSSOM when the FontFace changes: CSSFontFaces already have a RefPtr
255         to their StyleRuleFontFace which represents their CSS-connection. When changing a
256         property of the CSSFontFace, we simply reach into the StyleRule and update it to
257         match. Our existing infrastructure of invalidation due to the attribute changes
258         makes sure that all the necessary updates occur.
259
260         2. Updating the FontFace when the CSSOM changes: If the CSSOM changes in a trivial
261         way (for example, a new @font-face is appended to the end of the last <style>
262         element), we can handle it directly. However, when something more invasive occurs,
263         we end up clearing the entire CSSFontSelector, and then adding all the style rules
264         from scratch. This involves three steps:
265             a) CSSFontSelector::buildStarted() is run, which means "we're about to start
266                building up all the @font-face rules from scratch." We take this opportunity
267                to purge as many fonts as possible. This is valuable because, for example,
268                this function gets run when the page gets put into the page cache, so we
269                want to destroy as much as possible. Not everything can be purged, however -
270                only CSS-connected fonts which have never been inspected by script are
271                purgeable. We don't allow fonts inspected by script to be purged because
272                purging might result in a font appearing from JavaScript to transition from
273                a success -> failure state, which we don't allow.
274             b) Upon style recalc (possibly asynchronously) CSSFontSelector::addFontFaceRule()
275                is called for each @font-face rule. We actually detect that we're in the
276                middle of a style rebuild, and defer this step.
277             c) When we're done adding all the font face rules, we call
278                CSSFontSelector::buildCompleted(). This is where we compare the newly built-
279                up list of font faces with what existed previously (as remembered in
280                CSSFontSelector::buildStarted()) in order to detect font faces which were
281                deleted from the document. Fonts which were newly added to the document
282                are handled naturally.
283                Fonts which have a property modified on them are created as if they were new.
284                However, instead of simply adding the CSSFontFace, we search for the existing
285                CSSFontFace (by CSS connection pointer) and tell the existing FontFace to
286                adopt this new CSSFontFace. This means that the JavaScript object will just
287                pick up any newly-written values in the CSSOM. It also means that the
288                "status" attribute of the JavaScript object is reset, but this is expected
289                and allowed by the spec. (For example, if you change the "src" attribute of
290                an @font-face block via the CSSOM, all bets are off when you inspect the
291                FontFace JS object representing that block.)
292
293         Test: fast/text/font-face-set-cssom.html
294
295         * css/CSSFontFace.cpp:
296         (WebCore::CSSFontFace::CSSFontFace):
297         (WebCore::CSSFontFace::setFamilies):
298         (WebCore::CSSFontFace::setStyle):
299         (WebCore::CSSFontFace::setWeight):
300         (WebCore::CSSFontFace::setUnicodeRange):
301         (WebCore::CSSFontFace::setVariantLigatures):
302         (WebCore::CSSFontFace::setVariantPosition):
303         (WebCore::CSSFontFace::setVariantCaps):
304         (WebCore::CSSFontFace::setVariantNumeric):
305         (WebCore::CSSFontFace::setVariantAlternates):
306         (WebCore::CSSFontFace::setVariantEastAsian):
307         (WebCore::CSSFontFace::setFeatureSettings):
308         (WebCore::CSSFontFace::initializeWrapper):
309         (WebCore::CSSFontFace::wrapper):
310         (WebCore::CSSFontFace::setWrapper):
311         (WebCore::CSSFontFace::purgeable):
312         (WebCore::CSSFontFace::updateStyleIfNeeded):
313         * css/CSSFontFace.h:
314         * css/CSSFontFaceSet.cpp:
315         (WebCore::CSSFontFaceSet::remove):
316         (WebCore::CSSFontFaceSet::containsCSSConnection):
317         (WebCore::CSSFontFaceSet::purge):
318         * css/CSSFontFaceSet.h:
319         * css/CSSFontSelector.cpp:
320         (WebCore::CSSFontSelector::buildStarted):
321         (WebCore::CSSFontSelector::buildCompleted):
322         (WebCore::CSSFontSelector::addFontFaceRule):
323         * css/CSSFontSelector.h:
324         * css/FontFace.cpp:
325         (WebCore::FontFace::family):
326         (WebCore::FontFace::style):
327         (WebCore::FontFace::weight):
328         (WebCore::FontFace::unicodeRange):
329         (WebCore::FontFace::variant):
330         (WebCore::FontFace::featureSettings):
331         (WebCore::FontFace::adopt):
332         * css/FontFace.h:
333
334 2016-06-11  Chris Dumez  <cdumez@apple.com>
335
336         WorkerNavigator is missing some attributes
337         https://bugs.webkit.org/show_bug.cgi?id=158593
338         <rdar://problem/26731334>
339
340         Reviewed by Darin Adler.
341
342         Add attributes that are missing on WorkerNavigator:
343         - appCodeName
344         - hardwareConcurrency
345         - language
346         - product
347         - productSub
348         - vendor
349         - vendorSub
350
351         Firefox and Chrome already expose those attributes.
352
353         Relevant specification:
354         https://html.spec.whatwg.org/multipage/workers.html#the-workernavigator-object
355
356         This patch also refactors the IDL to match the specification more
357         closely and promote sharing between Navigator and WorkerNavigator.
358
359         No new tests, updated existing test.
360
361         * CMakeLists.txt:
362         * DerivedSources.make:
363         Add new supplemental IDL files.
364
365         * page/Navigator.cpp:
366         * page/Navigator.h:
367         Moved language() / hardwareConcurrency() from Navigator to NavigatorBase
368         so that it can be used by NavigatorWorker as well.
369
370         * page/NavigatorBase.h:
371         * page/NavigatorBase.cpp:
372         (WebCore::NavigatorBase::language):
373         The implementation still calls defaultLanguage() but I updated it to be
374         thread safe on all platforms.
375
376         (WebCore::NavigatorBase::hardwareConcurrency):
377         Use std::call_once() for thread safety.
378
379         * page/Navigator.idl:
380         * page/NavigatorConcurrentHardware.idl: Copied from Source/WebCore/page/WorkerNavigator.idl.
381         * page/NavigatorID.idl: Copied from Source/WebCore/page/WorkerNavigator.idl.
382         * page/NavigatorLanguage.idl: Copied from Source/WebCore/page/WorkerNavigator.idl.
383         * page/NavigatorOnLine.idl: Copied from Source/WebCore/page/WorkerNavigator.idl.
384         * page/WorkerNavigator.idl:
385         Move several attributes to their own supplemental interfaces to match
386         the specification and promote sharing with WorkerNavigator.
387
388         * platform/Language.cpp:
389         (WebCore::userPreferredLanguages):
390         * platform/Language.h:
391         Made thread-safe on all platforms.
392
393 2016-06-11  Antti Koivisto  <antti@apple.com>
394
395         Build fix.
396
397         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
398         (WebCore::NetworkStorageSession::switchToNewTestingSession):
399
400 2016-06-10  Antti Koivisto  <antti@apple.com>
401
402         Vary:Cookie validation doesn't work in private browsing
403         https://bugs.webkit.org/show_bug.cgi?id=158616
404         rdar://problem/26755067
405
406         Reviewed by Darin Adler.
407
408         This wasn't implemented because there was no way to get NetworkStorageSession from
409         a SessionID on WebCore side.
410
411         The patch adds a simple WebCore level weak map that allows getting NetworkStorageSessions
412         from SessionID. This seemed like the cleanest way to do this without a big refactoring
413         around the currently WebKit2 level SessionTracker.
414
415         * CMakeLists.txt:
416         * WebCore.xcodeproj/project.pbxproj:
417         * platform/network/CacheValidation.cpp:
418         (WebCore::headerValueForVary):
419
420             Get NetworkStorageSession from SessionID for cookies
421
422         (WebCore::verifyVaryingRequestHeaders):
423         * platform/network/NetworkStorageSession.cpp: Added.
424
425             Add platform independent .cpp for NetworkStorageSession.
426             Implement a weak map for SessionID -> NetworkStorageSession.
427
428         (WebCore::sessionsMap):
429         (WebCore::NetworkStorageSession::NetworkStorageSession):
430         (WebCore::NetworkStorageSession::~NetworkStorageSession):
431         (WebCore::NetworkStorageSession::forSessionID):
432
433             Get NetworkStorageSession for sessionID.
434
435         * platform/network/NetworkStorageSession.h:
436         (WebCore::NetworkStorageSession::sessionID):
437         (WebCore::NetworkStorageSession::credentialStorage):
438         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
439         (WebCore::NetworkStorageSession::NetworkStorageSession):
440
441             Call to common constructor.
442
443         (WebCore::defaultNetworkStorageSession):
444         * platform/network/soup/NetworkStorageSessionSoup.cpp:
445         (WebCore::NetworkStorageSession::NetworkStorageSession):
446
447             Call to common constructor.
448
449         (WebCore::defaultSession):
450         (WebCore::NetworkStorageSession::~NetworkStorageSession): Deleted.
451
452 2016-06-10  Ada Chan  <adachan@apple.com>
453
454         Use the video element's video box when getting the inline video rect in WebVideoFullscreenManager
455         https://bugs.webkit.org/show_bug.cgi?id=158351
456         <rdar://problem/26567938>
457
458         Reviewed by Darin Adler.
459
460         * WebCore.xcodeproj/project.pbxproj:
461         Change the visibility of RenderVideo.h and RenderMedia.h since we'll be importing RenderVideo.h from WebKit2.
462         * rendering/RenderVideo.h:
463
464 2016-06-10  Benjamin Poulain  <bpoulain@apple.com>
465
466         Add support for passive event listeners on touch events
467         https://bugs.webkit.org/show_bug.cgi?id=158601
468
469         Reviewed by Simon Fraser.
470
471         This patch wires "passive" state of EventTarget to the delivery of touch
472         events in WebKit2.
473
474         Instead of having a NonFastScrollableRegion, we have a pair of regions
475         in EventTrackingRegions.
476         The "asynchronousDispatchRegion" tracks the area for which all event
477         listeners are passive. For those, events should be dispatched asynchronously.
478         The "synchronousDispatchRegion" tracks the area for which there is at
479         least one active event listener. Events have to be dispatched synchronously
480         for correctness.
481
482         Tests: fast/events/touch/ios/tap-with-active-listener-on-elements.html
483                fast/events/touch/ios/tap-with-active-listener-on-window.html
484                fast/events/touch/ios/tap-with-passive-listener-on-elements.html
485                fast/events/touch/ios/tap-with-passive-listener-on-window.html
486
487         * WebCore.xcodeproj/project.pbxproj:
488         * dom/Document.cpp:
489         (WebCore::Document::wheelEventHandlersChanged):
490         (WebCore::Document::Document): Deleted.
491         * dom/Document.h:
492
493         * dom/EventListenerMap.cpp:
494         (WebCore::EventListenerMap::containsActive):
495         If a Target has multiple listener for an event type, we want to know
496         if any of them is active.
497
498         * dom/EventListenerMap.h:
499         * dom/EventTarget.cpp:
500         (WebCore::EventTarget::hasActiveEventListeners):
501         (WebCore::EventTarget::hasActiveTouchEventListeners):
502         * dom/EventTarget.h:
503
504         * page/DebugPageOverlays.cpp:
505         (WebCore::NonFastScrollableRegionOverlay::updateRegion):
506         I did not change the debug overlays.
507         The NonFastScrollable area is the region for which events needs
508         synchronous dispatch. Everything else should scroll without delay.
509
510         * page/FrameView.cpp:
511         (WebCore::FrameView::scrollableAreaSetChanged):
512         * page/Page.cpp:
513         (WebCore::Page::nonFastScrollableRects):
514         * page/scrolling/AsyncScrollingCoordinator.cpp:
515         (WebCore::AsyncScrollingCoordinator::setEventTrackingRegionsDirty):
516         (WebCore::AsyncScrollingCoordinator::willCommitTree):
517         (WebCore::AsyncScrollingCoordinator::updateEventTrackingRegions):
518         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
519         (WebCore::AsyncScrollingCoordinator::frameViewEventTrackingRegionsChanged):
520         (WebCore::AsyncScrollingCoordinator::scrollingStateTreeAsText):
521         (WebCore::AsyncScrollingCoordinator::setNonFastScrollableRegionDirty): Deleted.
522         (WebCore::AsyncScrollingCoordinator::updateNonFastScrollableRegion): Deleted.
523         (WebCore::AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged): Deleted.
524         * page/scrolling/AsyncScrollingCoordinator.h:
525         (WebCore::AsyncScrollingCoordinator::eventTrackingRegionsDirty):
526         (WebCore::AsyncScrollingCoordinator::nonFastScrollableRegionDirty): Deleted.
527
528         * page/scrolling/ScrollingCoordinator.cpp:
529         (WebCore::ScrollingCoordinator::absoluteEventTrackingRegionsForFrame):
530         (WebCore::ScrollingCoordinator::absoluteEventTrackingRegions):
531         (WebCore::ScrollingCoordinator::absoluteNonFastScrollableRegionForFrame): Deleted.
532         (WebCore::ScrollingCoordinator::absoluteNonFastScrollableRegion): Deleted.
533         I intentionally left the Wheel event with synchronous dispatch.
534         This use case will need its own set of tests.
535
536         * page/scrolling/ScrollingCoordinator.h:
537         (WebCore::ScrollingCoordinator::frameViewEventTrackingRegionsChanged):
538         (WebCore::ScrollingCoordinator::frameViewNonFastScrollableRegionChanged): Deleted.
539         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
540         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
541         (WebCore::ScrollingStateFrameScrollingNode::setEventTrackingRegions):
542         (WebCore::ScrollingStateFrameScrollingNode::dumpProperties):
543         (WebCore::ScrollingStateFrameScrollingNode::setNonFastScrollableRegion): Deleted.
544         * page/scrolling/ScrollingStateFrameScrollingNode.h:
545         * page/scrolling/ScrollingTree.cpp:
546         (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
547         (WebCore::ScrollingTree::commitNewTreeState):
548         (WebCore::ScrollingTree::eventTrackingTypeForPoint):
549         (WebCore::ScrollingTree::isPointInNonFastScrollableRegion): Deleted.
550         * page/scrolling/ScrollingTree.h:
551         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
552         (WebCore::ScrollingCoordinatorMac::scheduleTreeStateCommit):
553         * platform/EventTrackingRegions.h: Added.
554         (WebCore::EventTrackingRegions::isEmpty):
555         (WebCore::EventTrackingRegions::trackingTypeForPoint):
556         (WebCore::operator==):
557
558 2016-06-10  Enrica Casucci  <enrica@apple.com>
559
560         REGRESSION(r198177): Cannot paste an image when the pasteboard format is mime type.
561         https://bugs.webkit.org/show_bug.cgi?id=158590
562         rdar://problem/25471371
563
564         Reviewed by Darin Adler.
565
566         When creating a fragment from an image resource, the resource needs to
567         be added to the document loader before setting the src attribute to the
568         image element, otherwise loading is triggered and the loading fails.
569         In r198177 the order of the operations was changed causing the bug.
570         This patch adds support to test the scenario where the image in the pasteboard
571         is available only as mime type (not WebArchive or RTFD), a situation that occurs
572         more frequently on iOS.
573
574         Test: editing/pasteboard/image-in-iframe.html
575
576         * editing/ios/EditorIOS.mm:
577         (WebCore::Editor::createFragmentForImageResourceAndAddResource):
578         * editing/mac/EditorMac.mm:
579         (WebCore::Editor::WebContentReader::readWebArchive):
580         (WebCore::Editor::WebContentReader::readRTFD):
581         (WebCore::Editor::WebContentReader::readRTF):
582         (WebCore::Editor::createFragmentForImageResourceAndAddResource):
583         * page/Settings.cpp:
584         (WebCore::Settings::setImagesEnabled):
585         (WebCore::Settings::setPreferMimeTypeForImages):
586         (WebCore::Settings::setForcePendingWebGLPolicy):
587         * page/Settings.h:
588         (WebCore::Settings::areImagesEnabled):
589         (WebCore::Settings::preferMimeTypeForImages):
590         (WebCore::Settings::arePluginsEnabled):
591         * testing/InternalSettings.cpp:
592         (WebCore::InternalSettings::Backup::restoreTo):
593         (WebCore::InternalSettings::setLangAttributeAwareFormControlUIEnabled):
594         (WebCore::InternalSettings::setPreferMimeTypeForImages):
595         (WebCore::InternalSettings::setImagesEnabled):
596         * testing/InternalSettings.h:
597         * testing/InternalSettings.idl:
598
599 2016-06-10  Alex Christensen  <achristensen@webkit.org>
600
601         Fix WinCairo build after r201943
602
603         * platform/network/curl/MultipartHandle.cpp:
604         (WebCore::MultipartHandle::didReceiveResponse):
605         * platform/network/curl/ResourceHandleManager.cpp:
606         (WebCore::handleLocalReceiveResponse):
607         (WebCore::headerCallback):
608         (WebCore::ResourceHandleManager::dispatchSynchronousJob):
609
610 2016-06-10  Alex Christensen  <achristensen@webkit.org>
611
612         handleDataURL is only used by curl
613         https://bugs.webkit.org/show_bug.cgi?id=158636
614
615         Reviewed by Tim Horton.
616
617         * CMakeLists.txt:
618         * platform/network/DataURL.cpp: Removed.
619         * platform/network/DataURL.h: Removed.
620         * platform/network/curl/ResourceHandleManager.cpp:
621         (WebCore::ResourceHandleManager::startScheduledJobs):
622         (WebCore::handleDataURL):
623         (WebCore::ResourceHandleManager::dispatchSynchronousJob):
624
625 2016-06-10  Alex Christensen  <achristensen@webkit.org>
626
627         Reduce ResourceResponse copying
628         https://bugs.webkit.org/show_bug.cgi?id=158232
629
630         Reviewed by Darin Adler.
631
632         No new tests.  No change in behavior except removing an unnecessary copy on cocoa platforms.
633
634         * loader/ResourceLoader.cpp:
635         (WebCore::ResourceLoader::didSendData):
636         (WebCore::ResourceLoader::didReceiveResponse):
637         * loader/ResourceLoader.h:
638         * loader/appcache/ApplicationCacheGroup.cpp:
639         (WebCore::ApplicationCacheGroup::createResourceHandle):
640         (WebCore::ApplicationCacheGroup::didReceiveResponse):
641         * loader/appcache/ApplicationCacheGroup.h:
642         * platform/graphics/PlatformMediaResourceLoader.h:
643         (WebCore::PlatformMediaResourceClient::~PlatformMediaResourceClient):
644         (WebCore::PlatformMediaResourceClient::responseReceived):
645         (WebCore::PlatformMediaResourceClient::redirectReceived):
646         (WebCore::PlatformMediaResourceClient::shouldCacheResponse):
647         (WebCore::PlatformMediaResourceClient::dataSent):
648         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.h:
649         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
650         (ResourceHandleStreamingClient::willSendRequest):
651         (ResourceHandleStreamingClient::didReceiveResponse):
652         * platform/network/BlobResourceHandle.cpp:
653         (WebCore::BlobResourceHandle::notifyResponseOnSuccess):
654         (WebCore::BlobResourceHandle::notifyResponseOnError):
655         (WebCore::BlobResourceHandle::notifyReceiveData):
656         * platform/network/DataURL.cpp:
657         (WebCore::handleDataURL):
658         * platform/network/PingHandle.h:
659         (WebCore::PingHandle::PingHandle):
660         * platform/network/ResourceHandleClient.cpp:
661         (WebCore::ResourceHandleClient::willSendRequestAsync):
662         (WebCore::ResourceHandleClient::didReceiveResponseAsync):
663         * platform/network/ResourceHandleClient.h:
664         (WebCore::ResourceHandleClient::didSendData):
665         (WebCore::ResourceHandleClient::didReceiveResponse):
666         (WebCore::ResourceHandleClient::didReceiveData):
667         * platform/network/ResourceResponseBase.cpp:
668         (WebCore::ResourceResponseBase::ResourceResponseBase):
669         (WebCore::ResourceResponseBase::includeCertificateInfo):
670         (WebCore::ResourceResponseBase::suggestedFilename):
671         (WebCore::ResourceResponseBase::certificateInfo): Deleted.
672         * platform/network/ResourceResponseBase.h:
673         (WebCore::ResourceResponseBase::certificateInfo):
674         (WebCore::ResourceResponseBase::encode):
675         (WebCore::ResourceResponseBase::decode):
676         (WebCore::ResourceResponseBase::containsCertificateInfo): Deleted.
677         * platform/network/SynchronousLoaderClient.cpp:
678         (WebCore::SynchronousLoaderClient::canAuthenticateAgainstProtectionSpace):
679         (WebCore::SynchronousLoaderClient::didReceiveResponse):
680         (WebCore::SynchronousLoaderClient::didReceiveData):
681         * platform/network/SynchronousLoaderClient.h:
682         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
683         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
684         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
685         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
686         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveData):
687         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
688         (-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]):
689         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
690         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
691         * platform/network/soup/ResourceHandleSoup.cpp:
692         (WebCore::nextMultipartResponsePartCallback):
693         (WebCore::sendRequestCallback):
694
695 2016-06-09  Ryosuke Niwa  <rniwa@webkit.org>
696
697         Add SPI to disable spellchecking on auto-fillable text fields
698         https://bugs.webkit.org/show_bug.cgi?id=158611
699
700         Reviewed by Anders Carlsson.
701
702         Added a boolean flag m_isSpellCheckingEnabled to HTMLInputElement. This flag defaults to true, and can be set
703         to false by WebKit2 C API.
704
705         * editing/Editor.cpp:
706         (WebCore::Editor::isSpellCheckingEnabledFor): Fixed a bug that we were calling isSpellCheckingEnabled on
707         the div inside an input element's shadow tree instead of the input element itself.
708         * html/HTMLInputElement.cpp:
709         (WebCore::HTMLInputElement::HTMLInputElement): Initialize m_spellcheckEnabled to true (it's a bit field).
710         (WebCore::HTMLInputElement::isSpellCheckingEnabled): Added. Return false if m_spellcheckEnabled is false.
711         * html/HTMLInputElement.h:
712         (WebCore::HTMLInputElement::setSpellcheckEnabled): Added.
713
714 2016-06-10  Alex Christensen  <achristensen@webkit.org>
715
716         Introduce WTF::UniqueRef
717         https://bugs.webkit.org/show_bug.cgi?id=158596
718
719         Reviewed by Brady Eidson.
720
721         No new tests.  No change in behavior.
722
723         * inspector/InspectorOverlay.cpp:
724         (WebCore::InspectorOverlay::overlayPage):
725         * loader/EmptyClients.cpp:
726         (WebCore::fillWithEmptyClients):
727         * page/Page.cpp:
728         (WebCore::Page::Page):
729         * page/Page.h:
730         (WebCore::Page::canStartMedia):
731         (WebCore::Page::editorClient):
732         (WebCore::Page::plugInClient):
733         (WebCore::Page::mainFrame):
734         (WebCore::Page::groupPtr): Deleted.
735         * page/PageConfiguration.cpp:
736         (WebCore::PageConfiguration::PageConfiguration):
737         * page/PageConfiguration.h:
738         * svg/graphics/SVGImage.cpp:
739         (WebCore::SVGImage::dataChanged):
740
741 2016-06-10  Joseph Pecoraro  <pecoraro@apple.com>
742
743         Web Inspector: Cleanup InspectorIndexedDBAgent a bit
744         https://bugs.webkit.org/show_bug.cgi?id=158598
745
746         Reviewed by Darin Adler.
747
748         * inspector/InspectorIndexedDBAgent.cpp:
749
750 2016-06-10  Youenn Fablet  <youenn.fablet@crf.canon.fr>
751
752         Origin header is not included in CORS requests for preloaded cross-origin resources
753         https://bugs.webkit.org/show_bug.cgi?id=155761
754         <rdar://problem/25351850>
755
756         Reviewed by Alex Christensen.
757
758         Making HTML preloader fully aware of crossorigin attribute value.
759         Introducing CachedResourceRequest::setAsPotentiallyCrossOrigin as a helper routine to activate CORS mode.
760         Making HTMLLinkElement and HTMLResourcePreloader use that routine.
761         Making TokenPreloadScanner store the crossorigin attribute value in preload requests.
762         Making TokenPreloadScanner store the crossorigin attribute value for link elements.
763
764         Test: http/tests/security/cross-origin-css-9.html
765
766         * html/HTMLLinkElement.cpp:
767         (WebCore::HTMLLinkElement::process):
768         * html/parser/HTMLPreloadScanner.cpp:
769         (WebCore::TokenPreloadScanner::StartTagScanner::createPreloadRequest):
770         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
771         * html/parser/HTMLResourcePreloader.cpp:
772         (WebCore::crossOriginModeAllowsCookies):
773         (WebCore::PreloadRequest::resourceRequest):
774         * html/parser/HTMLResourcePreloader.h:
775         (WebCore::PreloadRequest::setCrossOriginMode):
776         (WebCore::PreloadRequest::PreloadRequest): Deleted.
777         (WebCore::PreloadRequest::resourceType): Deleted.
778         * loader/cache/CachedResourceRequest.cpp:
779         (WebCore::CachedResourceRequest::setAsPotentiallyCrossOrigin):
780         * loader/cache/CachedResourceRequest.h:
781
782 2016-06-10  Chris Dumez  <cdumez@apple.com>
783
784         ErrorEvent / ProgressEvent should be exposed to workers
785         https://bugs.webkit.org/show_bug.cgi?id=158606
786
787         Reviewed by Brady Eidson.
788
789         ErrorEvent / ProgressEvent should be exposed to workers:
790         - https://html.spec.whatwg.org/multipage/webappapis.html#errorevent
791         - https://xhr.spec.whatwg.org/#interface-progressevent
792
793         Firefox and Chrome both already expose those.
794
795         No new tests, rebaselined existing test.
796
797         * dom/ErrorEvent.idl:
798         * dom/ProgressEvent.idl:
799
800 2016-06-10  Chris Dumez  <cdumez@apple.com>
801
802         MessagePort should be exposed to workers
803         https://bugs.webkit.org/show_bug.cgi?id=158607
804
805         Reviewed by Brady Eidson.
806
807         MessagePort should be exposed to workers:
808         https://html.spec.whatwg.org/multipage/comms.html#messageport
809
810         Firefox and Chrome both already expose it.
811
812         No new tests, rebaselined existing test.
813
814         * dom/MessagePort.idl:
815
816 2016-06-10  Youenn Fablet  <youenn.fablet@crf.canon.fr>
817
818         Move preflight check code outside of DocumentThreadableLoader
819         https://bugs.webkit.org/show_bug.cgi?id=158425
820
821         Reviewed by Darin Adler.
822
823         Moving preflight check code in its own class.
824         This allows code to be easier to read, use/reuse and update.
825
826         Behavior should be the same as before except in the case of a preflight response
827         being a 3XX redirect response.
828         Before this patch, the 3XX response was directly passed to the code processing regular responses.
829         To keep compatibility with existing tests, a didFailRedirectCheck callback is called.
830         This should be change to a preflight failure.
831
832         Covered by existing tests.
833
834         * CMakeLists.txt:
835         * WebCore.xcodeproj/project.pbxproj:
836         * loader/CrossOriginPreflightChecker.cpp: Added.
837         (WebCore::CrossOriginPreflightChecker::CrossOriginPreflightChecker):
838         (WebCore::CrossOriginPreflightChecker::~CrossOriginPreflightChecker):
839         (WebCore::CrossOriginPreflightChecker::handleLoadingFailure):
840         (WebCore::CrossOriginPreflightChecker::validatePreflightResponse):
841         (WebCore::CrossOriginPreflightChecker::notifyFinished):
842         (WebCore::CrossOriginPreflightChecker::startPreflight):
843         (WebCore::CrossOriginPreflightChecker::doPreflight):
844         (WebCore::CrossOriginPreflightChecker::redirectReceived):
845         (WebCore::CrossOriginPreflightChecker::setDefersLoading):
846         (WebCore::CrossOriginPreflightChecker::isXMLHttpRequest):
847         * loader/CrossOriginPreflightChecker.h: Added.
848         * loader/DocumentThreadableLoader.cpp:
849         (WebCore::DocumentThreadableLoader::create):
850         (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
851         (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequestWithPreflight):
852         (WebCore::DocumentThreadableLoader::setDefersLoading):
853         (WebCore::DocumentThreadableLoader::clearResource):
854         (WebCore::DocumentThreadableLoader::didReceiveResponse):
855         (WebCore::DocumentThreadableLoader::didReceiveData):
856         (WebCore::DocumentThreadableLoader::notifyFinished):
857         (WebCore::DocumentThreadableLoader::didFinishLoading):
858         (WebCore::DocumentThreadableLoader::didFail):
859         (WebCore::DocumentThreadableLoader::preflightSuccess):
860         (WebCore::DocumentThreadableLoader::preflightFailure):
861         (WebCore::DocumentThreadableLoader::loadRequest):
862         (WebCore::DocumentThreadableLoader::responseReceived): Deleted.
863         (WebCore::DocumentThreadableLoader::dataReceived): Deleted.
864         (WebCore::DocumentThreadableLoader::isAllowedByContentSecurityPolicy): Deleted.
865         * loader/DocumentThreadableLoader.h:
866         (WebCore::DocumentThreadableLoader::options):
867         (WebCore::DocumentThreadableLoader::isLoading):
868         (WebCore::DocumentThreadableLoader::document):
869
870 2016-06-10  Adam Bergkvist  <adam.bergkvist@ericsson.com>
871
872         WebRTC: Imlement MediaEndpointPeerConnection::createAnswer()
873         https://bugs.webkit.org/show_bug.cgi?id=158566
874
875         Reviewed by Eric Carlson.
876
877         Add the MediaEndpointPeerConnection implementation of RTCPeerConnection.createAnswer [1].
878         createAnswer() creates a 'reply' to an remote offer set with setRemoteDescription(),
879         completes the offer/answer dialog and brings the RTCPeerConnection back to the 'stable'
880         signaling state.
881
882         [1] https://w3c.github.io/webrtc-pc/archives/20160513/webrtc.html#dom-rtcpeerconnection-createanswer
883
884         Test: fast/mediastream/RTCPeerConnection-inspect-answer.html
885
886         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
887         (WebCore::MediaEndpointPeerConnection::createOfferTask):
888         Align creation of RTCSessionDescription with createAnswerTask.
889         (WebCore::MediaEndpointPeerConnection::createAnswer):
890         (WebCore::MediaEndpointPeerConnection::createAnswerTask):
891         Add Implementation.
892         * Modules/mediastream/MediaEndpointPeerConnection.h:
893
894 2016-06-08  Sergio Villar Senin  <svillar@igalia.com>
895
896         [css-grid] CRASH when getting the computed style of a grid with only absolutely positioned children
897         https://bugs.webkit.org/show_bug.cgi?id=158537
898
899         Reviewed by Darin Adler.
900
901         Absolute positioning occurs after layout of the grid and its in-flow contents, and does not
902         contribute to the sizing of any grid tracks or affect the size/configuration of the grid in
903         any way. This means that we should treat as empty any grid whose only children are
904         absolutely positioned items.
905
906         Since r201510 empty grids are no longer internally represented by a 1x1 matrix. As we were
907         not considering grids-with-only-absolutely-positioned-children as empty, we were trying to
908         access some invalid position in the internal representation of the grid triggering an ASSERT
909         in debug builds and a crash in release.
910
911         Test: fast/css-grid-layout/grid-only-abspos-item-computed-style-crash.html
912
913         * css/CSSComputedStyleDeclaration.cpp:
914         (WebCore::valueForGridTrackList):
915
916 2016-06-10  Chris Dumez  <cdumez@apple.com>
917
918         DOMException should be exposed to workers
919         https://bugs.webkit.org/show_bug.cgi?id=158608
920
921         Reviewed by Alex Christensen.
922
923         DOMException should be exposed to workers:
924         https://heycam.github.io/webidl/#es-DOMException-call
925
926         Both Firefox and Chrome expose DOMException to workers already.
927
928         No new tests, rebaselined existing test.
929
930         * dom/DOMCoreException.idl:
931
932 2016-06-09  Alex Christensen  <achristensen@webkit.org>
933
934         Fix CMake build.
935
936         * PlatformMac.cmake:
937
938 2016-06-09  Alex Christensen  <achristensen@webkit.org>
939
940         Fix AppleWin build after r201901.
941         https://bugs.webkit.org/show_bug.cgi?id=119839
942
943         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
944         (PlatformCALayerWin::backingStoreAttached):
945         (PlatformCALayerWin::userInteractionEnabled):
946         (PlatformCALayerWin::setUserInteractionEnabled):
947         (PlatformCALayerWin::geometryFlipped):
948         * platform/graphics/ca/win/PlatformCALayerWin.h:
949
950 2016-06-09  Chris Fleizach  <cfleizach@apple.com>
951
952         AX: VoiceOver Unable to View Download Progress or Completion Status for Mail Attachments
953         https://bugs.webkit.org/show_bug.cgi?id=158581
954
955         Reviewed by Darin Adler.
956
957         Update attachment element accessibility so that:
958            1) the action name comes first to match UI
959            2) on iOS, it has the updates frequently trait
960
961         Make sure this test now runs on iOS as well.
962
963         Modified tests: accessibility/attachment-element.html
964
965         * accessibility/AccessibilityAttachment.cpp:
966         (WebCore::AccessibilityAttachment::accessibilityText):
967         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
968         (-[WebAccessibilityObjectWrapper accessibilityCanFuzzyHitTest]):
969         (-[WebAccessibilityObjectWrapper accessibilityTraits]):
970         (-[WebAccessibilityObjectWrapper accessibilityValue]):
971         (-[WebAccessibilityObjectWrapper accessibilityIsAttachmentElement]):
972         (-[WebAccessibilityObjectWrapper accessibilityIsComboBox]):
973
974 2016-06-09  Alex Christensen  <achristensen@webkit.org>
975
976         Clean up WebCore.vcxproj after switching to CMake.
977
978         * WebCore.vcxproj/QTMovieWin: Removed.
979         * WebCore.vcxproj/QTMovieWin/QTMovieWinCairoDebug.props: Removed.
980         * WebCore.vcxproj/QTMovieWin/QTMovieWinCairoRelease.props: Removed.
981         * WebCore.vcxproj/QTMovieWin/QTMovieWinCommon.props: Removed.
982         * WebCore.vcxproj/QTMovieWin/QTMovieWinDebug.props: Removed.
983         * WebCore.vcxproj/QTMovieWin/QTMovieWinPostBuild.cmd: Removed.
984         * WebCore.vcxproj/QTMovieWin/QTMovieWinPreBuild.cmd: Removed.
985         * WebCore.vcxproj/QTMovieWin/QTMovieWinPreLink.cmd: Removed.
986         * WebCore.vcxproj/QTMovieWin/QTMovieWinProduction.props: Removed.
987         * WebCore.vcxproj/QTMovieWin/QTMovieWinRelease.props: Removed.
988         * WebCore.vcxproj/xcopy.excludes: Removed.
989
990 2016-06-09  Zalan Bujtas  <zalan@apple.com>
991
992         Hairline borders do not show up on 3x displays.
993         https://bugs.webkit.org/show_bug.cgi?id=158604
994         <rdar://problem/26511679>
995
996         Reviewed by Simon Fraser.
997
998         On a 3x display, when we convert a 1/3px hairline border from float
999         to LayoutUnit and pixel floor the result, we end up with a 0px width border.
1000         It's because float to LayoutUnit is lossy and since the current kFixedPointDenominator % 3 != 0,
1001         flooring LayoutUnit(1/3px) ends up being 0px. (float: 1/3 -> LayoutUnit: (1/3 - 1/kFixedPointDenominator) -> floor: 0)
1002         This patch eliminates the (unnecessary) float -> LayoutUnit - float conversion on border width.   
1003
1004         Test: fast/borders/hidpi-3x-input-hairline-border.html
1005
1006         * rendering/BorderEdge.cpp:
1007         (WebCore::BorderEdge::BorderEdge):
1008         * rendering/BorderEdge.h:
1009
1010 2016-06-09  Commit Queue  <commit-queue@webkit.org>
1011
1012         Unreviewed, rolling out r201887.
1013         https://bugs.webkit.org/show_bug.cgi?id=158610
1014
1015         This change caused LayoutTest crashes under GuardMalloc and
1016         ASan (Requested by ryanhaddad on #webkit).
1017
1018         Reverted changeset:
1019
1020         "Deleting a CSSOM style rule invalidates any previously-added
1021         FontFaces"
1022         https://bugs.webkit.org/show_bug.cgi?id=158450
1023         http://trac.webkit.org/changeset/201887
1024
1025 2016-06-09  Chris Dumez  <cdumez@apple.com>
1026
1027         Address Darin's review comment on r201898.
1028         https://bugs.webkit.org/show_bug.cgi?id=158576
1029
1030         Reviewed by Darin Adler.
1031
1032         * page/Base64Utilities.h:
1033
1034 2016-06-09  Antoine Quint  <graouts@apple.com>
1035
1036         [iOS] -webkit-overflow-scrolling: touch; ignores pointer-events: none;
1037         https://bugs.webkit.org/show_bug.cgi?id=119839
1038         <rdar://problem/9671514>
1039
1040         Reviewed by Simon Fraser.
1041
1042         Propagate a "userInteractionEnabled" flag from the Web process which is used to turn off
1043         user interaction on a UIScrollView created for -webkit-overflow-scrolling: touch.
1044
1045         Test: fast/scrolling/ios/touch-scroll-pointer-events-none.html
1046
1047         * platform/graphics/GraphicsLayer.cpp:
1048         (WebCore::GraphicsLayer::GraphicsLayer):
1049         * platform/graphics/GraphicsLayer.h:
1050         (WebCore::GraphicsLayer::userInteractionEnabled):
1051         (WebCore::GraphicsLayer::setUserInteractionEnabled):
1052         * platform/graphics/ca/GraphicsLayerCA.cpp:
1053         (WebCore::GraphicsLayerCA::setUserInteractionEnabled):
1054         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
1055         (WebCore::GraphicsLayerCA::updateUserInteractionEnabled):
1056         * platform/graphics/ca/GraphicsLayerCA.h:
1057         * platform/graphics/ca/PlatformCALayer.h:
1058         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
1059         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1060         (PlatformCALayerCocoa::userInteractionEnabled):
1061         (PlatformCALayerCocoa::setUserInteractionEnabled):
1062         * rendering/RenderLayerBacking.cpp:
1063         (WebCore::RenderLayerBacking::updateAfterDescendants):
1064
1065 2016-06-09  Chris Dumez  <cdumez@apple.com>
1066
1067         WorkerNavigator property should exist on WorkerGlobalScope
1068         https://bugs.webkit.org/show_bug.cgi?id=158574
1069         <rdar://problem/26725108>
1070
1071         Reviewed by Darin Adler.
1072
1073         WorkerNavigator property should exist on WorkerGlobalScope:
1074         https://html.spec.whatwg.org/multipage/workers.html#the-workernavigator-object
1075
1076         Fixing this gets the number of failures on http://w3c-test.org/workers/interfaces.worker
1077         from 34 to 23.
1078
1079         No new tests, rebaselined existing test.
1080
1081         * page/WorkerNavigator.idl:
1082
1083 2016-06-09  Chris Dumez  <cdumez@apple.com>
1084
1085         atob() / btoa() API should be exposed to workers
1086         https://bugs.webkit.org/show_bug.cgi?id=158576
1087         <rdar://problem/26729340>
1088
1089         Reviewed by Sam Weinig.
1090
1091         Expose atob() / btoa() API to workers as per:
1092         https://html.spec.whatwg.org/multipage/webappapis.html#windoworworkerglobalscope
1093
1094         This aligns our behavior with Firefox and Chrome as well.
1095
1096         Test: fast/workers/atob-btoa.html
1097
1098         * CMakeLists.txt:
1099         * DerivedSources.cpp:
1100         * DerivedSources.make:
1101         * PlatformMac.cmake:
1102         * WebCore.xcodeproj/project.pbxproj:
1103         * page/Base64Utilities.cpp: Added.
1104         (WebCore::Base64Utilities::btoa):
1105         (WebCore::Base64Utilities::atob):
1106         * page/Base64Utilities.h: Added.
1107         * page/DOMWindow.cpp:
1108         (WebCore::DOMWindow::find): Deleted.
1109         (WebCore::DOMWindow::offscreenBuffering): Deleted.
1110         (WebCore::DOMWindow::outerHeight): Deleted.
1111         (WebCore::DOMWindow::outerWidth): Deleted.
1112         * page/DOMWindow.h:
1113         * page/DOMWindow.idl:
1114         * page/WindowBase64.idl: Removed.
1115         * page/WindowOrWorkerGlobalScope.idl: Renamed from Source/WebCore/page/WindowTimers.idl.
1116         * workers/WorkerGlobalScope.h:
1117         * workers/WorkerGlobalScope.idl:
1118
1119 2016-06-09  John Wilander  <wilander@apple.com>
1120
1121         Restrict HTTP/0.9 responses to default ports and cancel HTTP/0.9 resource loads if the document was loaded with another HTTP protocol
1122         https://bugs.webkit.org/show_bug.cgi?id=158589
1123         <rdar://problem/25757454>
1124
1125         Reviewed by Brent Fulgham.
1126
1127         No new tests. Our layout test environment does not allow for headerless responses
1128         nor does it allow you to set an explicit HTTP/0.9 status header in PHP. I have
1129         manually tested this change with a Python socket setup doing both headerless and
1130         HTTP/0.9 header tests for positive and negative cases.
1131
1132         * loader/DocumentLoader.cpp:
1133         (WebCore::DocumentLoader::responseReceived):
1134             Cancel loads if the request was made to a non-default port.
1135         * loader/ResourceLoader.cpp:
1136         (WebCore::ResourceLoader::didReceiveResponse):
1137             Cancel loads if the request was made to a non-default port or if the document
1138             was loaded with another protocol. Cancelation is handled as a fail so as to
1139             fire the onerror event and allow sites to handle it gracefully.
1140
1141 2016-06-09  Alex Christensen  <achristensen@webkit.org>
1142
1143         Clean up EditorClient lifetime
1144         https://bugs.webkit.org/show_bug.cgi?id=158588
1145
1146         Reviewed by Anders Carlsson.
1147
1148         No new tests.  This patch does two things, all of which do not change behavior:
1149         1. Use a std::unique_ptr<EditorClient> owned by the Page instead of allocating
1150         with new in WebKit/WebKit2 and deleting in WebEditorClient::pageDestroyed.
1151         2. Give the Page a PageConfiguration&& instead of a PageConfiguration& in its constructor.
1152
1153         * inspector/InspectorOverlay.cpp:
1154         (WebCore::InspectorOverlay::overlayPage):
1155         * loader/EmptyClients.cpp:
1156         (WebCore::fillWithEmptyClients):
1157         * loader/EmptyClients.h:
1158         (WebCore::EmptyEditorClient::EmptyEditorClient):
1159         (WebCore::EmptyEditorClient::~EmptyEditorClient):
1160         * page/EditorClient.h:
1161         (WebCore::EditorClient::~EditorClient):
1162         * page/Page.cpp:
1163         (WebCore::Page::Page):
1164         (WebCore::Page::~Page):
1165         (WebCore::Page::setViewMode):
1166         (WebCore::Page::clearUndoRedoOperations):
1167         (WebCore::Page::inLowQualityImageInterpolationMode):
1168         (WebCore::Page::invalidateStylesForAllLinks):
1169         (WebCore::Page::invalidateStylesForLink):
1170         (WebCore::Page::invalidateInjectedStyleSheetCacheInAllFrames):
1171         (WebCore::Page::setDebugger):
1172         (WebCore::Page::setIsVisibleInternal):
1173         (WebCore::Page::setAllowsMediaDocumentInlinePlayback):
1174         * page/Page.h:
1175         (WebCore::Page::canStartMedia):
1176         (WebCore::Page::editorClient):
1177         (WebCore::Page::plugInClient):
1178         (WebCore::Page::mainFrame):
1179         (WebCore::Page::group):
1180         * page/PageConfiguration.cpp:
1181         * page/PageConfiguration.h:
1182         * page/mac/PageMac.mm:
1183         (WebCore::Page::addSchedulePair):
1184         (WebCore::Page::removeSchedulePair):
1185         * svg/graphics/SVGImage.cpp:
1186         (WebCore::SVGImage::dataChanged):
1187
1188 2016-06-09  Joseph Pecoraro  <pecoraro@apple.com>
1189
1190         REGRESSION: Web Inspector: IndexedDB does not show ObjectStore data
1191         https://bugs.webkit.org/show_bug.cgi?id=158592
1192         <rdar://problem/26730696>
1193
1194         Reviewed by Timothy Hatcher.
1195
1196         * inspector/InspectorIndexedDBAgent.cpp:
1197         (WebCore::DataLoader::execute):
1198         Ensure the IDBTransaction is active when attempting to open a cursor.
1199
1200         (WebCore::OpenCursorCallback::handleEvent):
1201         End, when the cursor result is empty, like we do for script results.
1202
1203 2016-06-09  Antoine Quint  <graouts@apple.com>
1204
1205         Changing canvas height immediately after page load does not relayout canvas
1206         https://bugs.webkit.org/show_bug.cgi?id=156097
1207
1208         Reviewed by Zalan Bujtas.
1209
1210         Promote the logic use to identify whether we should perform a layout after a change of
1211         intrinsic size from RenderImage to RenderReplaced such that RenderCanvas may use it
1212         in canvasSizeChanged() and correctly update its layout in the case where the width
1213         or height attribute is updated and there are no explicit sizing performed with CSS.
1214         Additionally, this will also account for the object-fix property to only perform
1215         a layout if necessary.
1216
1217         Test: fast/canvas/canvas-css-size-after-height-change-with-display-flex.html
1218
1219         * rendering/RenderHTMLCanvas.cpp:
1220         (WebCore::RenderHTMLCanvas::canvasSizeChanged):
1221         * rendering/RenderImage.cpp:
1222         (WebCore::RenderImage::repaintOrMarkForLayout):
1223         * rendering/RenderReplaced.cpp:
1224         (WebCore::RenderReplaced::setNeedsLayoutIfNeededAfterIntrinsicSizeChange):
1225         * rendering/RenderReplaced.h:
1226
1227 2016-06-09  Myles C. Maxfield  <mmaxfield@apple.com>
1228
1229         Deleting a CSSOM style rule invalidates any previously-added FontFaces
1230         https://bugs.webkit.org/show_bug.cgi?id=158450
1231
1232         Reviewed by Darin Adler.
1233
1234         This patch has two pieces: updating the CSSOM when the FontFace changes, and
1235         updating the FontFace when the CSSOM changes.
1236
1237         1: Updating the CSSOM when the FontFace changes: CSSFontFaces already have a RefPtr
1238         to their StyleRuleFontFace which represents their CSS-connection. When changing a
1239         property of the CSSFontFace, we simply reach into the StyleRule and update it to
1240         match. Our existing infrastructure of invalidation due to the attribute changes
1241         makes sure that all the necessary updates occur.
1242
1243         2. Updating the FontFace when the CSSOM changes: If the CSSOM changes in a trivial
1244         way (for example, a new @font-face is appended to the end of the last <style>
1245         element), we can handle it directly. However, when something more invasive occurs,
1246         we end up clearing the entire CSSFontSelector, and then adding all the style rules
1247         from scratch. This involves three steps:
1248             a) CSSFontSelector::buildStarted() is run, which means "we're about to start
1249                building up all the @font-face rules from scratch." We take this opportunity
1250                to purge as many fonts as possible. This is valuable because, for example,
1251                this function gets run when the page gets put into the page cache, so we
1252                want to destroy as much as possible. Not everything can be purged, however -
1253                only CSS-connected fonts which have never been inspected by script are
1254                purgeable. We don't allow fonts inspected by script to be purged because
1255                purging might result in a font appearing from JavaScript to transition from
1256                a success -> failure state, which we don't allow.
1257             b) Upon style recalc (possibly asynchronously) CSSFontSelector::addFontFaceRule()
1258                is called for each @font-face rule. We actually detect that we're in the
1259                middle of a style rebuild, and defer this step.
1260             c) When we're done adding all the font face rules, we call
1261                CSSFontSelector::buildCompleted(). This is where we compare the newly built-
1262                up list of font faces with what existed previously (as remembered in
1263                CSSFontSelector::buildStarted()) in order to detect font faces which were
1264                deleted from the document. Fonts which were newly added to the document
1265                are handled naturally.
1266                Fonts which have a property modified on them are created as if they were new.
1267                However, instead of simply adding the CSSFontFace, we search for the existing
1268                CSSFontFace (by CSS connection pointer) and tell the existing FontFace to
1269                adopt this new CSSFontFace. This means that the JavaScript object will just
1270                pick up any newly-written values in the CSSOM. It also means that the
1271                "status" attribute of the JavaScript object is reset, but this is expected
1272                and allowed by the spec. (For example, if you change the "src" attribute of
1273                an @font-face block via the CSSOM, all bets are off when you inspect the
1274                FontFace JS object representing that block.)
1275
1276         Test: fast/text/font-face-set-cssom.html
1277
1278         * css/CSSFontFace.cpp:
1279         (WebCore::CSSFontFace::CSSFontFace):
1280         (WebCore::CSSFontFace::setFamilies):
1281         (WebCore::CSSFontFace::setStyle):
1282         (WebCore::CSSFontFace::setWeight):
1283         (WebCore::CSSFontFace::setUnicodeRange):
1284         (WebCore::CSSFontFace::setVariantLigatures):
1285         (WebCore::CSSFontFace::setVariantPosition):
1286         (WebCore::CSSFontFace::setVariantCaps):
1287         (WebCore::CSSFontFace::setVariantNumeric):
1288         (WebCore::CSSFontFace::setVariantAlternates):
1289         (WebCore::CSSFontFace::setVariantEastAsian):
1290         (WebCore::CSSFontFace::setFeatureSettings):
1291         (WebCore::CSSFontFace::initializeWrapper):
1292         (WebCore::CSSFontFace::wrapper):
1293         (WebCore::CSSFontFace::setWrapper):
1294         (WebCore::CSSFontFace::purgeable):
1295         (WebCore::CSSFontFace::updateStyleIfNeeded):
1296         * css/CSSFontFace.h:
1297         * css/CSSFontFaceSet.cpp:
1298         (WebCore::CSSFontFaceSet::remove):
1299         (WebCore::CSSFontFaceSet::containsCSSConnection):
1300         (WebCore::CSSFontFaceSet::purge):
1301         * css/CSSFontFaceSet.h:
1302         * css/CSSFontSelector.cpp:
1303         (WebCore::CSSFontSelector::buildStarted):
1304         (WebCore::CSSFontSelector::buildCompleted):
1305         (WebCore::CSSFontSelector::addFontFaceRule):
1306         * css/CSSFontSelector.h:
1307         * css/FontFace.cpp:
1308         (WebCore::FontFace::family):
1309         (WebCore::FontFace::style):
1310         (WebCore::FontFace::weight):
1311         (WebCore::FontFace::unicodeRange):
1312         (WebCore::FontFace::variant):
1313         (WebCore::FontFace::featureSettings):
1314         (WebCore::FontFace::adopt):
1315         * css/FontFace.h:
1316
1317 2016-06-09  Andy Estes  <aestes@apple.com>
1318
1319         Define printing{Minimum,Maximum}ShrinkFactor in only one place
1320         https://bugs.webkit.org/show_bug.cgi?id=158580
1321
1322         Reviewed by Tim Horton.
1323
1324         * page/PrintContext.cpp: Removed printingMinimumShrinkFactor and printingMaximumShrinkFactor.
1325         (WebCore::PrintContext::begin): Used minimumShrinkFactor() and maximumShrinkFactor() instead
1326         of printingMinimumShrinkFactor and printingMaximumShrinkFactor.
1327         (WebCore::PrintContext::computeAutomaticScaleFactor): Ditto.
1328         * page/PrintContext.h:
1329         (WebCore::PrintContext::minimumShrinkFactor): Added to return the same value as
1330         printingMinimumShrinkFactor.
1331         (WebCore::PrintContext::maximumShrinkFactor): Added to return the same value as
1332         printingMaximumShrinkFactor.
1333
1334 2016-06-09  Eric Carlson  <eric.carlson@apple.com>
1335
1336         Don't show the caption menu if a video has only forced tracks
1337         https://bugs.webkit.org/show_bug.cgi?id=158573
1338         <rdar://problem/24632384>
1339
1340         Reviewed by Jer Noble.
1341
1342         Test: media/controls/forced-tracks-only.html
1343
1344         * Modules/mediacontrols/mediaControlsApple.js:
1345         (Controller.prototype.updateCaptionButton): Don't show the button of there are no user-selectable
1346           text or audio tracks.
1347
1348         * page/CaptionUserPreferencesMediaAF.cpp:
1349         (WebCore::CaptionUserPreferencesMediaAF::sortedTrackListForMenu): Return an empty Vector if
1350           there are no user-selectable tracks.
1351
1352 2016-06-09  Jer Noble  <jer.noble@apple.com>
1353
1354         Pass through play state and toggle state to the WebPlaybackControlsManager
1355         https://bugs.webkit.org/show_bug.cgi?id=158578
1356         <rdar://problem/25045616>
1357
1358         Reviewed by Beth Dakin.
1359
1360         Pass through the isPlaying portion of setRate() and allow toggling when a model is present.
1361
1362         * platform/mac/WebPlaybackControlsManager.h:
1363         * platform/mac/WebPlaybackControlsManager.mm:
1364         * platform/mac/WebPlaybackSessionInterfaceMac.mm:
1365         (WebCore::WebPlaybackSessionInterfaceMac::setRate):
1366         (WebCore::WebPlaybackSessionInterfaceMac::setPlayBackControlsManager):
1367
1368 2016-06-09  Frederic Wang  <fred.wang@free.fr>
1369
1370         RenderMathOperator: Move calculation of preferred width into MathOperator
1371         https://bugs.webkit.org/show_bug.cgi?id=157071
1372
1373         Reviewed by Brent Fulgham.
1374
1375         No new tests, behavior is not change.
1376
1377         * rendering/mathml/MathOperator.cpp:
1378         (WebCore::MathOperator::setOperator): Introduce a style parameter and call reset.
1379         (WebCore::MathOperator::reset): New helper function to reset the operator.
1380         For now we only set the width of the base glyph and the preferred max width.
1381         (WebCore::MathOperator::calculateDisplayStyleLargeOperator): Calculate the m_maxPreferredWidth.
1382         (WebCore::MathOperator::calculateStretchyData): Change the signature of the function and directly set m_maxPreferredWidth.
1383         * rendering/mathml/MathOperator.h: Add m_maxPreferredWidth member and update some declarations.
1384         (WebCore::MathOperator::width): New helper function.
1385         (WebCore::MathOperator::maxPreferredWidth): New helper function.
1386         * rendering/mathml/RenderMathMLOperator.cpp:
1387         (WebCore::RenderMathMLOperator::computePreferredLogicalWidths): This function performs wrong
1388         operations that will be fixed in bug 152244 when we update the tests.
1389         For now, let's just use maxPreferredWidth() for non-horizontal operators.
1390         (WebCore::RenderMathMLOperator::updateStyle): Use the new signature of the functions.
1391
1392 2016-06-09  Alex Christensen  <achristensen@webkit.org>
1393
1394         Clean up WebSocket code
1395         https://bugs.webkit.org/show_bug.cgi?id=158551
1396
1397         Reviewed by Darin Adler.
1398
1399         No new tests.  There is no change in behavior.
1400         There seems to be no reason why SocketStreamHandle should be an AuthenticationClient.
1401
1402         * Modules/websockets/ThreadableWebSocketChannel.h:
1403         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
1404         (WebCore::ThreadableWebSocketChannelClientWrapper::setSendRequestResult):
1405         (WebCore::ThreadableWebSocketChannelClientWrapper::bufferedAmount):
1406         (WebCore::ThreadableWebSocketChannelClientWrapper::setBufferedAmount):
1407         (WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveBinaryData):
1408         (WebCore::ThreadableWebSocketChannelClientWrapper::didUpdateBufferedAmount):
1409         (WebCore::ThreadableWebSocketChannelClientWrapper::didStartClosingHandshake):
1410         (WebCore::ThreadableWebSocketChannelClientWrapper::didClose):
1411         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.h:
1412         * Modules/websockets/WebSocket.cpp:
1413         (WebCore::joinStrings):
1414         (WebCore::saturateAdd):
1415         (WebCore::WebSocket::send):
1416         (WebCore::WebSocket::readyState):
1417         (WebCore::WebSocket::bufferedAmount):
1418         (WebCore::WebSocket::didReceiveBinaryData):
1419         (WebCore::WebSocket::didReceiveMessageError):
1420         (WebCore::WebSocket::didUpdateBufferedAmount):
1421         (WebCore::WebSocket::didStartClosingHandshake):
1422         (WebCore::WebSocket::didClose):
1423         * Modules/websockets/WebSocket.h:
1424         * Modules/websockets/WebSocketChannel.cpp:
1425         (WebCore::WebSocketChannel::WebSocketChannel):
1426         (WebCore::WebSocketChannel::~WebSocketChannel):
1427         (WebCore::WebSocketChannel::send):
1428         (WebCore::WebSocketChannel::bufferedAmount):
1429         (WebCore::WebSocketChannel::resume):
1430         (WebCore::WebSocketChannel::willOpenSocketStream):
1431         (WebCore::WebSocketChannel::didOpenSocketStream):
1432         (WebCore::WebSocketChannel::didCloseSocketStream):
1433         (WebCore::WebSocketChannel::didReceiveSocketStreamData):
1434         (WebCore::WebSocketChannel::didUpdateBufferedAmount):
1435         (WebCore::WebSocketChannel::didFailSocketStream):
1436         (WebCore::WebSocketChannel::didStartLoading):
1437         (WebCore::WebSocketChannel::appendToBuffer):
1438         (WebCore::WebSocketChannel::processBuffer):
1439         (WebCore::WebSocketChannel::resumeTimerFired):
1440         (WebCore::WebSocketChannel::startClosingHandshake):
1441         (WebCore::WebSocketChannel::didReceiveAuthenticationChallenge): Deleted.
1442         (WebCore::WebSocketChannel::didCancelAuthenticationChallenge): Deleted.
1443         * Modules/websockets/WebSocketChannel.h:
1444         * Modules/websockets/WebSocketChannelClient.h:
1445         (WebCore::WebSocketChannelClient::~WebSocketChannelClient):
1446         (WebCore::WebSocketChannelClient::didConnect):
1447         (WebCore::WebSocketChannelClient::didReceiveMessage):
1448         (WebCore::WebSocketChannelClient::didReceiveBinaryData):
1449         (WebCore::WebSocketChannelClient::didReceiveMessageError):
1450         (WebCore::WebSocketChannelClient::didUpdateBufferedAmount):
1451         (WebCore::WebSocketChannelClient::didStartClosingHandshake):
1452         (WebCore::WebSocketChannelClient::didClose):
1453         (WebCore::WebSocketChannelClient::WebSocketChannelClient):
1454         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
1455         (WebCore::WorkerThreadableWebSocketChannel::send):
1456         (WebCore::WorkerThreadableWebSocketChannel::bufferedAmount):
1457         (WebCore::WorkerThreadableWebSocketChannel::Peer::bufferedAmount):
1458         (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveBinaryData):
1459         (WebCore::WorkerThreadableWebSocketChannel::Peer::didUpdateBufferedAmount):
1460         (WebCore::WorkerThreadableWebSocketChannel::Peer::didStartClosingHandshake):
1461         (WebCore::WorkerThreadableWebSocketChannel::Peer::didClose):
1462         (WebCore::WorkerThreadableWebSocketChannel::Bridge::send):
1463         (WebCore::WorkerThreadableWebSocketChannel::Bridge::bufferedAmount):
1464         * Modules/websockets/WorkerThreadableWebSocketChannel.h:
1465         * platform/network/BlobData.cpp:
1466         (WebCore::BlobData::appendData):
1467         (WebCore::BlobData::appendFile):
1468         * platform/network/BlobData.h:
1469         (WebCore::BlobDataItem::BlobDataItem):
1470         * platform/network/BlobRegistry.h:
1471         * platform/network/BlobRegistryImpl.cpp:
1472         (WebCore::BlobRegistryImpl::appendStorageItems):
1473         (WebCore::BlobRegistryImpl::registerFileBlobURL):
1474         (WebCore::BlobRegistryImpl::registerBlobURL):
1475         (WebCore::BlobRegistryImpl::registerBlobURLOptionallyFileBacked):
1476         (WebCore::BlobRegistryImpl::registerBlobURLForSlice):
1477         * platform/network/BlobRegistryImpl.h:
1478         * platform/network/SocketStreamHandleBase.cpp:
1479         (WebCore::SocketStreamHandleBase::send):
1480         (WebCore::SocketStreamHandleBase::disconnect):
1481         (WebCore::SocketStreamHandleBase::sendPendingData):
1482         * platform/network/SocketStreamHandleBase.h:
1483         * platform/network/SocketStreamHandleClient.h:
1484         (WebCore::SocketStreamHandleClient::~SocketStreamHandleClient):
1485         (WebCore::SocketStreamHandleClient::willOpenSocketStream):
1486         (WebCore::SocketStreamHandleClient::didOpenSocketStream):
1487         (WebCore::SocketStreamHandleClient::didCloseSocketStream):
1488         (WebCore::SocketStreamHandleClient::didReceiveSocketStreamData):
1489         (WebCore::SocketStreamHandleClient::didUpdateBufferedAmount):
1490         (WebCore::SocketStreamHandleClient::didFailSocketStream):
1491         (WebCore::SocketStreamHandleClient::didReceiveAuthenticationChallenge): Deleted.
1492         (WebCore::SocketStreamHandleClient::didCancelAuthenticationChallenge): Deleted.
1493         * platform/network/cf/SocketStreamHandle.h:
1494         (WebCore::SocketStreamHandle::create):
1495         (WebCore::SocketStreamHandle::refAuthenticationClient): Deleted.
1496         (WebCore::SocketStreamHandle::derefAuthenticationClient): Deleted.
1497         * platform/network/cf/SocketStreamHandleCFNet.cpp:
1498         (WebCore::SocketStreamHandle::SocketStreamHandle):
1499         (WebCore::SocketStreamHandle::addCONNECTCredentials):
1500         (WebCore::SocketStreamHandle::copyCFStreamDescription):
1501         (WebCore::SocketStreamHandle::readStreamCallback):
1502         (WebCore::SocketStreamHandle::writeStreamCallback):
1503         (WebCore::SocketStreamHandle::reportErrorToClient):
1504         (WebCore::SocketStreamHandle::~SocketStreamHandle):
1505         (WebCore::SocketStreamHandle::platformClose):
1506         (WebCore::SocketStreamHandle::port):
1507         (WebCore::SocketStreamHandle::receivedCredential): Deleted.
1508         (WebCore::SocketStreamHandle::receivedRequestToContinueWithoutCredential): Deleted.
1509         (WebCore::SocketStreamHandle::receivedCancellation): Deleted.
1510         (WebCore::SocketStreamHandle::receivedRequestToPerformDefaultHandling): Deleted.
1511         (WebCore::SocketStreamHandle::receivedChallengeRejection): Deleted.
1512         * platform/network/curl/ResourceHandleCurl.cpp:
1513         * platform/network/curl/SocketStreamHandle.h:
1514         (WebCore::SocketStreamHandle::SocketData::SocketData):
1515         * platform/network/curl/SocketStreamHandleCurl.cpp:
1516         (WebCore::SocketStreamHandle::platformClose):
1517         (WebCore::SocketStreamHandle::readData):
1518         (WebCore::SocketStreamHandle::didReceiveData):
1519         (WebCore::SocketStreamHandle::didOpenSocket):
1520         (WebCore::SocketStreamHandle::createCopy):
1521         (WebCore::SocketStreamHandle::didReceiveAuthenticationChallenge): Deleted.
1522         (WebCore::SocketStreamHandle::receivedCredential): Deleted.
1523         (WebCore::SocketStreamHandle::receivedRequestToContinueWithoutCredential): Deleted.
1524         (WebCore::SocketStreamHandle::receivedCancellation): Deleted.
1525         (WebCore::SocketStreamHandle::receivedRequestToPerformDefaultHandling): Deleted.
1526         (WebCore::SocketStreamHandle::receivedChallengeRejection): Deleted.
1527         * platform/network/soup/SocketStreamHandle.h:
1528         (WebCore::SocketStreamHandle::create):
1529         * platform/network/soup/SocketStreamHandleSoup.cpp:
1530         (WebCore::getHandleFromId):
1531         (WebCore::deactivateHandle):
1532         (WebCore::activateHandle):
1533         (WebCore::SocketStreamHandle::SocketStreamHandle):
1534         (WebCore::SocketStreamHandle::~SocketStreamHandle):
1535         (WebCore::SocketStreamHandle::connected):
1536         (WebCore::SocketStreamHandle::readBytes):
1537         (WebCore::SocketStreamHandle::platformSend):
1538         (WebCore::SocketStreamHandle::platformClose):
1539         (WebCore::SocketStreamHandle::beginWaitingForSocketWritability):
1540         (WebCore::SocketStreamHandle::didReceiveAuthenticationChallenge): Deleted.
1541         (WebCore::SocketStreamHandle::receivedCredential): Deleted.
1542         (WebCore::SocketStreamHandle::receivedRequestToContinueWithoutCredential): Deleted.
1543         (WebCore::SocketStreamHandle::receivedCancellation): Deleted.
1544         (WebCore::SocketStreamHandle::receivedRequestToPerformDefaultHandling): Deleted.
1545         (WebCore::SocketStreamHandle::receivedChallengeRejection): Deleted.
1546
1547 2016-06-09  Commit Queue  <commit-queue@webkit.org>
1548
1549         Unreviewed, rolling out r201815.
1550         https://bugs.webkit.org/show_bug.cgi?id=158570
1551
1552         This broke the cmake build. (Requested by lforschler on
1553         #webkit).
1554
1555         Reverted changeset:
1556
1557         "Teach cmake about libWebKitSystemInterfaceOSX10.12"
1558         http://trac.webkit.org/changeset/201815
1559
1560 2016-06-09  Chris Dumez  <cdumez@apple.com>
1561
1562         WorkerGlobalScope attributes / operations should be on the prototype
1563         https://bugs.webkit.org/show_bug.cgi?id=158568
1564         <rdar://problem/26720079>
1565
1566         Reviewed by Geoffrey Garen.
1567
1568         WorkerGlobalScope attributes / operations should be on the prototype
1569         because WorkerGlobalScope is not marked as [Global] / [PrimaryGlobal]:
1570         - https://html.spec.whatwg.org/multipage/workers.html#the-workerglobalscope-common-interface
1571         - http://heycam.github.io/webidl/#es-attributes
1572         - http://heycam.github.io/webidl/#es-operations
1573
1574         DedicatedWorkerGlobalScope is the interface that is marked as [Global]
1575         and whose attributes / operations should be on the instance.
1576
1577         This brings the number of failures on http://w3c-test.org/workers/interfaces.worker
1578         from 65 to 34. It also aligns our behavior with Firefox and Chrome.
1579
1580         Test: fast/workers/WorkerGlobalScope-properties-prototype.html
1581
1582         * bindings/scripts/CodeGeneratorJS.pm:
1583         (InterfaceRequiresAttributesOnInstance):
1584         (OperationShouldBeOnInstance):
1585
1586 2016-06-09  Tim Horton  <timothy_horton@apple.com>
1587
1588         Writing-mode-dependent properties don't apply if their value is a variable
1589         https://bugs.webkit.org/show_bug.cgi?id=158449
1590         <rdar://problem/26662478>
1591
1592         Reviewed by Simon Fraser.
1593
1594         Test: fast/css/variables/direction-dependent-variable-properties.html
1595
1596         * css/CSSParser.cpp:
1597         (WebCore::CSSParser::parseVariableDependentValue):
1598         * css/CSSParser.h:
1599         * css/StyleResolver.cpp:
1600         (WebCore::StyleResolver::resolvedVariableValue):
1601         CSSVariableDependentValue stores the unresolved (direction-dependent) property ID,
1602         because the property that it resolves to cannot be determined until style resolution time.
1603         Plumb the requisite direction and writing mode information into parseVariableDependentValue
1604         at style resolution time so that the property can be resolved to the correct
1605         non-direction-dependent property for each use of the value.
1606
1607 2016-06-09  Ryan Haddad  <ryanhaddad@apple.com>
1608
1609         Attempt to fix the iOS build.
1610
1611         Unreviewed build fix.
1612
1613         * platform/network/mac/ResourceErrorMac.mm:
1614         (WebCore::ResourceError::ResourceError):
1615
1616 2016-06-09  Simon Fraser  <simon.fraser@apple.com>
1617
1618         border-radius with different width and height rendered wrong
1619         https://bugs.webkit.org/show_bug.cgi?id=158300
1620         <rdar://problem/26672922>
1621
1622         Reviewed by Zalan Bujtas.
1623
1624         Borders with border-radius close to 100% 100% got oddly clipped. This happened because
1625         of the clipping we do to achieve the diagonal corner joins; RenderBoxModelObject::clipBorderSidePolygon()
1626         created trapezoids for each side, but only extended them to the center of the inner border rect.
1627         This clipped out parts of these borders.
1628
1629         Fix by computing the trapezoids by intersecting the corner diagonal line with a line that passes
1630         through the adjacent corners of the inner rect, whose intersection is always going to be inside the
1631         rounded border. Also fix the quads used to do the antialiased/non-antialiased clipping,
1632         by adding a point rather than moving a corner point to ensure we don't mistakenly clip out any
1633         parts of the border.
1634         
1635         Finally, improve the rendering of non-renderable cases by actually doing the diagonal
1636         corner joins rather than just giving up.
1637
1638         Tests: fast/borders/border-non-renderable-radius-inner-clip.html
1639                fast/borders/border-radius-inner-clip-vertical.html
1640                fast/borders/border-radius-inner-clip.html
1641
1642         * rendering/RenderBoxModelObject.cpp:
1643         (WebCore::calculateAdjustedInnerBorder): Moved up.
1644         (WebCore::RenderBoxModelObject::paintOneBorderSide):
1645         (WebCore::RenderBoxModelObject::clipBorderSidePolygon):
1646         (WebCore::findInnerVertex): Deleted.
1647         (WebCore::calculateSideRectIncludingInner): Deleted.
1648         (WebCore::RenderBoxModelObject::clipBorderSideForComplexInnerPath): Deleted.
1649         * rendering/RenderBoxModelObject.h:
1650
1651 2016-06-09  Xabier Rodriguez Calvar  <calvaris@igalia.com>
1652
1653         Unreviewed, fixing compilation issue with WebRTC
1654
1655         The code dependencies of the SDP processor were not right.
1656
1657         * PlatformGTK.cmake:
1658
1659 2016-06-09  Frederic Wang  <fwang@igalia.com>
1660
1661         Introduce MathOperator::Type
1662         https://bugs.webkit.org/show_bug.cgi?id=156950
1663
1664         Reviewed by Sergio Villar Senin.
1665
1666         No new tests, behavior is not change.
1667
1668         An enum Type is introduced in MathOperator in order to indicate
1669         which kind of stretching is requested. In follow-up work, this will
1670         allow to just call setOperator and stretchTo without having to
1671         explicitly call calculateDisplayStyleLargeOperator or calculateStretchyData.
1672
1673         * rendering/mathml/MathOperator.cpp:
1674         (WebCore::MathOperator::setOperator): Use Type instead of a boolean.
1675         (WebCore::MathOperator::setGlyphAssembly): Add an assert to ensure that the function is correctly used.
1676         (WebCore::MathOperator::calculateDisplayStyleLargeOperator): Ditto, this makes the assert more accurate.
1677         (WebCore::MathOperator::calculateStretchyData): Ditto and replace m_isVertical with a local isVertical variable.
1678         (WebCore::MathOperator::fillWithVerticalExtensionGlyph): Ditto.
1679         (WebCore::MathOperator::fillWithHorizontalExtensionGlyph): Ditto.
1680         (WebCore::MathOperator::paintVerticalGlyphAssembly): Ditto.
1681         (WebCore::MathOperator::paintHorizontalGlyphAssembly): Ditto.
1682         * rendering/mathml/MathOperator.h: Add the Type enum.
1683         (WebCore::MathOperator::stretchSize): Use Type instead of a boolean and add an
1684         assert to ensure that the function is correctly used.
1685         * rendering/mathml/RenderMathMLOperator.cpp:
1686         (WebCore::RenderMathMLOperator::computePreferredLogicalWidths): Call setOperator with the correct value.
1687         (WebCore::RenderMathMLOperator::updateStyle): Ditto.
1688
1689 2016-06-09  Commit Queue  <commit-queue@webkit.org>
1690
1691         Unreviewed, rolling out r201810.
1692         https://bugs.webkit.org/show_bug.cgi?id=158563
1693
1694         breaks build without ENABLE_WEB_ANIMATION (Requested by
1695         mcatanzaro on #webkit).
1696
1697         Reverted changeset:
1698
1699         "[web-animations] Add Animatable, AnimationEffect,
1700         KeyframeEffect and Animation interface"
1701         https://bugs.webkit.org/show_bug.cgi?id=156096
1702         http://trac.webkit.org/changeset/201810
1703
1704 2016-06-09  Ryosuke Niwa  <rniwa@webkit.org>
1705
1706         slotchange event should be fired at the end of microtask
1707         https://bugs.webkit.org/show_bug.cgi?id=157374
1708         <rdar://problem/26154024>
1709
1710         Reviewed by Antti Koivisto.
1711
1712         Dispatch slotchange event at the end of every microtask after delivering records to mutation observers
1713         as specified in: https://dom.spec.whatwg.org/#notify-mutation-observers
1714
1715         Test: fast/shadow-dom/slotchange-event.html
1716
1717         * dom/Document.cpp:
1718         (WebCore::Document::enqueueSlotchangeEvent): Deleted.
1719         * dom/Document.h:
1720         * dom/MutationObserver.cpp:
1721         (WebCore::signalSlotList): Added.
1722         (WebCore::MutationObserverMicrotask::run): mutationObserverCompoundMicrotaskQueuedFlag is now unset in
1723         notifyMutationObservers to better match the concept to "notify mutation observers".
1724         (WebCore::MutationObserver::enqueueSlotChangeEvent): Added.
1725         (WebCore::MutationObserver::notifyMutationObservers): Renamed from deliverAllMutations. Added the code
1726         to dispatch slotchange events as spec'ed, and also added comments for each step.
1727         * dom/MutationObserver.h:
1728         * html/HTMLSlotElement.cpp:
1729         (WebCore::HTMLSlotElement::enqueueSlotChangeEvent): Use MutationObserver::enqueueSlotChangeEvent. Don't
1730         create an event here since that is only needed when dispatching the event, and to keep track of whether
1731         we've already scheduled an event or not. Use a boolean flag instead for the latter. 
1732         (WebCore::HTMLSlotElement::dispatchSlotChangeEvent): Added. Creates and dispatches an event.
1733         (WebCore::HTMLSlotElement::dispatchEvent): Deleted.
1734         * html/HTMLSlotElement.h:
1735         (WebCore::HTMLSlotElement::didRemoveFromSignalSlotList): Added.
1736
1737 2016-06-08  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1738
1739         Introduce ResourceErrorBase::type
1740         https://bugs.webkit.org/show_bug.cgi?id=158299
1741
1742         Reviewed by Alex Christensen.
1743
1744         Introducing an enum type for ResourceErrorBase.
1745         In most cases, the type is set at construction time.
1746         By default, constructor with no parameters will set type to Null.
1747         Constructor with parameters will set type to General.
1748
1749         Removed boolean state error fields.
1750
1751         Introduced a type setter. It should only be used to  make the type
1752         more precise (when type is Null or General).
1753
1754         Updating related calling code.
1755
1756         No change of behavior.
1757
1758         * loader/DocumentLoader.cpp:
1759         (WebCore::DocumentLoader::stopLoadingForPolicyChange):
1760         * loader/DocumentThreadableLoader.cpp:
1761         (WebCore::DocumentThreadableLoader::cancel):
1762         * loader/EmptyClients.h:
1763         * loader/FrameLoader.cpp:
1764         (WebCore::FrameLoader::cancelledError):
1765         (WebCore::FrameLoader::blockedError):
1766         * loader/WorkerThreadableLoader.cpp:
1767         (WebCore::WorkerThreadableLoader::MainThreadBridge::cancel):
1768         * platform/network/ResourceErrorBase.cpp:
1769         (WebCore::ResourceErrorBase::isolatedCopy):
1770         (WebCore::ResourceErrorBase::setType):
1771         (WebCore::ResourceErrorBase::compare):
1772         * platform/network/ResourceErrorBase.h:
1773         (WebCore::ResourceErrorBase::isNull):
1774         (WebCore::ResourceErrorBase::isCancellation):
1775         (WebCore::ResourceErrorBase::isTimeout):
1776         (WebCore::ResourceErrorBase::type):
1777         (WebCore::ResourceErrorBase::ResourceErrorBase):
1778         (WebCore::ResourceErrorBase::domain):
1779         * platform/network/cf/ResourceError.h:
1780         (WebCore::ResourceError::ResourceError):
1781         * platform/network/cf/ResourceErrorCF.cpp:
1782         (WebCore::ResourceError::ResourceError):
1783         (WebCore::ResourceError::cfError):
1784         * platform/network/curl/ResourceError.h:
1785         (WebCore::ResourceError::ResourceError):
1786         * platform/network/mac/ResourceErrorMac.mm:
1787         (WebCore::m_platformError):
1788         (WebCore::ResourceError::nsError):
1789         (WebCore::ResourceError::ResourceError):
1790         (WebCore::ResourceError::platformLazyInit):
1791         * platform/network/soup/ResourceError.h:
1792         (WebCore::ResourceError::ResourceError):
1793         * platform/network/soup/ResourceErrorSoup.cpp:
1794         (WebCore::ResourceError::timeoutError):
1795
1796 2016-06-08  Frederic Wang  <fwang@igalia.com>
1797
1798         Move selection and drawing of stretchy operators into a separate MathOperator class
1799         https://bugs.webkit.org/show_bug.cgi?id=156921
1800
1801         Reviewed by Martin Robinson.
1802
1803         No new tests, behavior is not changed.
1804
1805         * CMakeLists.txt: Add the MathOperator files.
1806         * WebCore.xcodeproj/project.pbxproj: Ditto.
1807         * rendering/mathml/MathOperator.cpp: Added.
1808         (WebCore::boundsForGlyph): Moved from RenderMathMLOperator.
1809         (WebCore::heightForGlyph): Moved from RenderMathMLOperator.
1810         (WebCore::advanceWidthForGlyph): Moved from RenderMathMLOperator.
1811         (WebCore::MathOperator::MathOperator):
1812         (WebCore::MathOperator::setOperator):
1813         (WebCore::MathOperator::getBaseGlyph): Moved from RenderMathMLOperator.
1814         (WebCore::MathOperator::setSizeVariant): Moved from RenderMathMLOperator.
1815         (WebCore::MathOperator::setGlyphAssembly): Moved from RenderMathMLOperator.
1816         (WebCore::MathOperator::calculateDisplayStyleLargeOperator): Moved from RenderMathMLOperator with additional style parameter.
1817         (WebCore::MathOperator::calculateGlyphAssemblyFallBack): Ditto.
1818         (WebCore::MathOperator::calculateStretchyData): Ditto.
1819         (WebCore::MathOperator::paintGlyph): Ditto.
1820         (WebCore::MathOperator::fillWithVerticalExtensionGlyph): Ditto.
1821         (WebCore::MathOperator::fillWithHorizontalExtensionGlyph): Ditto.
1822         (WebCore::MathOperator::paintVerticalGlyphAssembly): Ditto.
1823         (WebCore::MathOperator::paintHorizontalGlyphAssembly): Ditto.
1824         * rendering/mathml/MathOperator.h: Added.
1825         (WebCore::MathOperator::italicCorrection):
1826         (WebCore::MathOperator::isStretched):
1827         (WebCore::MathOperator::unstretch):
1828         (WebCore::MathOperator::GlyphAssemblyData::GlyphAssemblyData): Moved from RenderMathMLOperator.
1829         (WebCore::MathOperator::stretchSize):
1830         * rendering/mathml/RenderMathMLOperator.cpp:
1831         (WebCore::RenderMathMLOperator::computePreferredLogicalWidths): Updated to use MathOperator members.
1832         For now we call setOperator to transmit information to m_mathOperator.
1833         (WebCore::RenderMathMLOperator::updateStyle): Updated to use MathOperator members.
1834         For now we set some m_mathOperator members to transmit it some information.
1835         (WebCore::RenderMathMLOperator::firstLineBaseline): Updated to use MathOperator members.
1836         (WebCore::RenderMathMLOperator::computeLogicalHeight): Ditto.
1837         (WebCore::RenderMathMLOperator::paint): Ditto.
1838         For now we set some m_mathOperator members to transmit it some information.
1839         (WebCore::RenderMathMLOperator::paintChildren): Updated to use MathOperator members.
1840         (WebCore::RenderMathMLOperator::trailingSpaceError): Ditto.
1841         (WebCore::RenderMathMLOperator::getBaseGlyph): Deleted.
1842         (WebCore::RenderMathMLOperator::setSizeVariant): Deleted.
1843         (WebCore::RenderMathMLOperator::setGlyphAssembly): Deleted.
1844         (WebCore::RenderMathMLOperator::calculateGlyphAssemblyFallBack): Deleted.
1845         (WebCore::RenderMathMLOperator::calculateDisplayStyleLargeOperator): Deleted.
1846         (WebCore::RenderMathMLOperator::calculateStretchyData): Deleted.
1847         (WebCore::RenderMathMLOperator::paintGlyph): Deleted.
1848         (WebCore::RenderMathMLOperator::fillWithVerticalExtensionGlyph): Deleted.
1849         (WebCore::RenderMathMLOperator::fillWithHorizontalExtensionGlyph): Deleted.
1850         (WebCore::RenderMathMLOperator::paintVerticalGlyphAssembly): Deleted.
1851         (WebCore::RenderMathMLOperator::paintHorizontalGlyphAssembly): Deleted.
1852         * rendering/mathml/RenderMathMLOperator.h:
1853         (WebCore::RenderMathMLOperator::italicCorrection): Updated to use MathOperator members.
1854         (WebCore::RenderMathMLOperator::GlyphAssemblyData::GlyphAssemblyData): Deleted.
1855
1856 2016-06-08  Chris Dumez  <cdumez@apple.com>
1857
1858         DedicatedWorkerGlobalScope prototype chain is incorrect
1859         https://bugs.webkit.org/show_bug.cgi?id=158544
1860
1861         Reviewed by Brady Eidson.
1862
1863         There were several issues with the prototype chain of DedicatedWorkerGlobalScope:
1864         1. Object.getPrototypeOf(DedicatedWorkerGlobalScope.prototype) was not
1865            WorkerGlobalScope.prototype.
1866         2. WorkerGlobalScope.prototype was a DedicatedWorkerGlobalScopePrototype
1867            object and was equal to DedicatedWorkerGlobalScope.prototype.
1868         3. Object.getPrototypeOf(WorkerGlobalScope.prototype) was not EventTarget.prototype.
1869
1870         Those issues were identified by the following W3C web-platform-test:
1871         http://w3c-test.org/workers/interfaces.worker
1872
1873         This patch fixes the issue so that the prototype chain is now as per the
1874         specification.
1875
1876         Test: fast/workers/DedicatedWorkerGlobalScope-prototype-chain.html
1877
1878         * bindings/js/WorkerScriptController.cpp:
1879         (WebCore::WorkerScriptController::initScript):
1880         - Stop creating the WorkerGlobalScopePrototype and let JSWorkerGlobalScope
1881           create it.
1882         - Set DedicatedWorkerGlobalScopePrototype's prototype to JSWorkerGlobalScope's
1883           prototype after creating the JSDedicatedWorkerGlobalScope object.
1884
1885         * bindings/scripts/CodeGeneratorJS.pm:
1886         (ShouldUseGlobalObjectPrototype):
1887         (GenerateHeader):
1888         (GenerateImplementation):
1889         (GenerateConstructorHelperMethods):
1890         - Do not use globalObject.getPrototypeDirect() as 'prototype' property for
1891           WorkerGlobalScope. The globalObject is a DedicatedWorkerGlobalScope, not
1892           a WorkerGlobalScope.
1893         - Generate the code to create / get a prototype object for WorkerGlobalScope.
1894
1895
1896 2016-06-08  Adam Bergkvist  <adam.bergkvist@ericsson.com>
1897
1898         WebRTC: Imlement MediaEndpointPeerConnection::setRemoteDescription()
1899         https://bugs.webkit.org/show_bug.cgi?id=158467
1900
1901         Reviewed by Eric Carlson.
1902
1903         Implement MediaEndpointPeerConnection::setRemoteDescription() which verifies a
1904         remote offer or answer, configures the WebRTC backend and dispatches the 'track' events
1905         that represent the incoming media [1].
1906
1907         This change also updates the RTCTrackEvent [2] with a streams and a transceiver attribute.
1908
1909         [1] https://w3c.github.io/webrtc-pc/archives/20160513/webrtc.html#dom-rtcpeerconnection-setremotedescription
1910         [2] https://w3c.github.io/webrtc-pc/archives/20160513/webrtc.html#rtctrackevent
1911
1912         Tests: fast/mediastream/RTCPeerConnection-setRemoteDescription-offer.html
1913                fast/mediastream/RTCTrackEvent-constructor.html
1914
1915         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
1916         (WebCore::createSourceMap):
1917         (WebCore::MediaEndpointPeerConnection::setLocalDescriptionTask):
1918         (WebCore::MediaEndpointPeerConnection::setRemoteDescription):
1919         (WebCore::MediaEndpointPeerConnection::setRemoteDescriptionTask):
1920         Implemented.
1921         (WebCore::MediaEndpointPeerConnection::remoteDescription):
1922         (WebCore::MediaEndpointPeerConnection::currentRemoteDescription):
1923         (WebCore::MediaEndpointPeerConnection::pendingRemoteDescription):
1924         (WebCore::MediaEndpointPeerConnection::remoteDescriptionTypeValidForState):
1925         (WebCore::MediaEndpointPeerConnection::internalRemoteDescription):
1926         * Modules/mediastream/MediaEndpointPeerConnection.h:
1927         * Modules/mediastream/PeerConnectionBackend.h:
1928         * Modules/mediastream/RTCPeerConnection.cpp:
1929         (WebCore::RTCPeerConnection::addTransceiver):
1930         * Modules/mediastream/RTCPeerConnection.h:
1931         * Modules/mediastream/RTCRtpReceiver.h:
1932         (WebCore::RTCRtpReceiver::isDispatched):
1933         (WebCore::RTCRtpReceiver::setDispatched):
1934         * Modules/mediastream/RTCTrackEvent.cpp:
1935         (WebCore::RTCTrackEvent::create):
1936         (WebCore::RTCTrackEvent::RTCTrackEvent):
1937         * Modules/mediastream/RTCTrackEvent.h:
1938         (WebCore::RTCTrackEvent::streams):
1939         (WebCore::RTCTrackEvent::transceiver):
1940         * Modules/mediastream/RTCTrackEvent.idl:
1941         Add streams and transceiver attributes.
1942         * bindings/js/JSDictionary.cpp:
1943         (WebCore::JSDictionary::convertValue):
1944         * bindings/js/JSDictionary.h:
1945         * platform/mediastream/MediaEndpoint.h:
1946         * platform/mock/MockMediaEndpoint.cpp:
1947         (WebCore::MockMediaEndpoint::filterPayloads):
1948         (WebCore::MockMediaEndpoint::updateSendConfiguration):
1949         * platform/mock/MockMediaEndpoint.h:
1950
1951 2016-06-08  John Wilander  <wilander@apple.com>
1952
1953         Perform IDNA encoding on parameters for setHostAndPort and setHost
1954         https://bugs.webkit.org/show_bug.cgi?id=158371
1955         <rdar://problem/16869342>
1956
1957         Reviewed by Brent Fulgham.
1958
1959         Tests: fast/dom/set-document-location-host-to-unaccepted-values.html
1960                fast/dom/set-document-location-hostname-to-unaccepted-values.html
1961                http/tests/dom/set-document-location-host-to-accepted-values.html
1962                http/tests/dom/set-document-location-hostname-to-accepted-values.html
1963
1964         * platform/URL.cpp:
1965         (WebCore::containsOnlyASCII):
1966             Moved up to enable usage in URL::setHost and URL::setHostAndPort.
1967         (WebCore::appendEncodedHostname):
1968             Moved up to enable usage in URL::setHost and URL::setHostAndPort.
1969         (WebCore::URL::setHost):
1970             Now disallows the colon character, does IDNA encoding, and uses StringBuilder.
1971         (WebCore::URL::setHostAndPort):
1972             Now disallows multiple colons, disallows non-numeric ports, disallows the empty
1973             string, does IDNA encoding, and uses StringBuilder.
1974
1975 2016-06-08  Alex Christensen  <achristensen@webkit.org>
1976
1977         Fix WinCairo build.
1978
1979         * platform/network/curl/MultipartHandle.cpp:
1980         (WebCore::MultipartHandle::didReceiveResponse):
1981
1982 2016-06-08  Alex Christensen  <achristensen@webkit.org>
1983
1984         Fix WinCairo build.
1985
1986         * platform/network/curl/MultipartHandle.cpp:
1987         (WebCore::MultipartHandle::didReceiveResponse):
1988
1989 2016-06-08  Jer Noble  <jer.noble@apple.com>
1990
1991         With audio user gesture restriction in place, video.src = 'file', video.play() succeeds where it should fail.
1992         https://bugs.webkit.org/show_bug.cgi?id=158546
1993
1994         Reviewed by Eric Carlson.
1995
1996         Test: media/video-playback-restriction-play-before-load.html
1997
1998         Don't check that the media element isPlaying(); that will only return true if playback has begun.
1999         Instead, check !paused(), as that will be true as soon as the play() method returns.
2000
2001         * html/HTMLMediaElement.cpp:
2002         (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
2003         (WebCore::HTMLMediaElement::updateShouldPlay):
2004         * rendering/RenderLayer.h:
2005
2006 2016-06-08  Alex Christensen  <achristensen@webkit.org>
2007
2008         Modernize WebSocket code
2009         https://bugs.webkit.org/show_bug.cgi?id=158539
2010
2011         Reviewed by Brady Eidson.
2012
2013         No new tests, no change in behavior.
2014
2015         * Modules/websockets/ThreadableWebSocketChannel.cpp:
2016         (WebCore::ThreadableWebSocketChannel::create):
2017         * Modules/websockets/ThreadableWebSocketChannel.h:
2018         (WebCore::ThreadableWebSocketChannel::ThreadableWebSocketChannel):
2019         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
2020         (WebCore::ThreadableWebSocketChannelClientWrapper::ThreadableWebSocketChannelClientWrapper):
2021         (WebCore::ThreadableWebSocketChannelClientWrapper::create):
2022         (WebCore::ThreadableWebSocketChannelClientWrapper::processPendingTasks):
2023         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.h:
2024         * Modules/websockets/WebSocket.cpp:
2025         (WebCore::WebSocket::connect):
2026         * Modules/websockets/WebSocketChannel.cpp:
2027         (WebCore::WebSocketChannel::WebSocketChannel):
2028         * Modules/websockets/WebSocketChannel.h:
2029         (WebCore::WebSocketChannel::create):
2030         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
2031         (WebCore::WorkerThreadableWebSocketChannel::WorkerThreadableWebSocketChannel):
2032         (WebCore::WorkerThreadableWebSocketChannel::subprotocol):
2033         (WebCore::WorkerThreadableWebSocketChannel::extensions):
2034         (WebCore::WorkerThreadableWebSocketChannel::resume):
2035         (WebCore::WorkerThreadableWebSocketChannel::Peer::Peer):
2036         (WebCore::WorkerThreadableWebSocketChannel::Peer::send):
2037         (WebCore::WorkerThreadableWebSocketChannel::Peer::bufferedAmount):
2038         (WebCore::WorkerThreadableWebSocketChannel::Peer::didConnect):
2039         (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveMessage):
2040         (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveBinaryData):
2041         (WebCore::WorkerThreadableWebSocketChannel::Peer::didUpdateBufferedAmount):
2042         (WebCore::WorkerThreadableWebSocketChannel::Peer::didStartClosingHandshake):
2043         (WebCore::WorkerThreadableWebSocketChannel::Peer::didClose):
2044         (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveMessageError):
2045         (WebCore::WorkerThreadableWebSocketChannel::Bridge::Bridge):
2046         (WebCore::WorkerThreadableWebSocketChannel::Bridge::~Bridge):
2047         (WebCore::WorkerThreadableWebSocketChannel::Bridge::mainThreadInitialize):
2048         (WebCore::WorkerThreadableWebSocketChannel::Bridge::initialize):
2049         (WebCore::WorkerThreadableWebSocketChannel::Bridge::connect):
2050         (WebCore::WorkerThreadableWebSocketChannel::Bridge::send):
2051         (WebCore::WorkerThreadableWebSocketChannel::Bridge::bufferedAmount):
2052         (WebCore::WorkerThreadableWebSocketChannel::Bridge::close):
2053         (WebCore::WorkerThreadableWebSocketChannel::Bridge::setMethodNotCompleted):
2054         (WebCore::WorkerThreadableWebSocketChannel::Bridge::waitForMethodCompletion):
2055         * Modules/websockets/WorkerThreadableWebSocketChannel.h:
2056         (WebCore::WorkerThreadableWebSocketChannel::create):
2057         (WebCore::WorkerThreadableWebSocketChannel::Bridge::create):
2058
2059 2016-06-08  Chris Dumez  <cdumez@apple.com>
2060
2061         First parameter to MessagePort / DedicatedWorkerGlobalScope.postMessage() should be mandatory
2062         https://bugs.webkit.org/show_bug.cgi?id=158540
2063
2064         Reviewed by Geoffrey Garen.
2065
2066         First parameter to MessagePort / DedicatedWorkerGlobalScope.postMessage() should be mandatory:
2067         - https://html.spec.whatwg.org/multipage/comms.html#messageport
2068         - https://html.spec.whatwg.org/multipage/workers.html#dedicated-workers-and-the-dedicatedworkerglobalscope-interface
2069
2070         Previously, WebKit send a bogus MessageEvent whose data attribute is undefined. This would
2071         cause a testharness error when running the following W3C test:
2072         - http://w3c-test.org/workers/interfaces.worker
2073
2074         Firefox and Chrome already correctly throw in this case. Our Window.postMessage() API is also
2075         already throwing in this case.
2076
2077         Test: fast/workers/postMessage-missing-parameter.html
2078
2079         * bindings/js/JSMessagePortCustom.h:
2080         (WebCore::handlePostMessage):
2081
2082 2016-06-08  Gavin Barraclough  <barraclough@apple.com>
2083
2084         Remove removeDirect
2085         https://bugs.webkit.org/show_bug.cgi?id=158516
2086
2087         Reviewed by Ryosuke Niwa.
2088
2089         removeDirect is typically used as a subroutine of deleteProperty, but is also available to
2090         call directly. Having this functionality factored out to a separate routine is a bad idea
2091         on a couple of fronts:
2092
2093         - for the main use within deleteProperty there is redundancy (presence of the property
2094           was being checked twice) and inconsistency (the two functions returned different results
2095           in the case of a nonexistent property; the result from removeDirect was never observed).
2096
2097         - all uses of removeDirect are in practical terms incorrect. removeDirect had the
2098           advantage of ignoring the configurable (DontDelete) attributes, but this is achievable
2099           using the DeletePropertyMode setting - and the disadvantage of failing delete static
2100           table properties. Last uses were one that was removed in bug #158295 (where failure to
2101           delete static properties was a problem), and as addressed in this patch removeDirect is
2102           being used to implement runtime enabled features. This only works because we currently
2103           force reification of all properties on the DOM prototype objects, so in effect there are
2104           no static properties. In order to make the code robust such that runtime enabled
2105           features would still work even if we were not reifying static properties (a change we
2106           may want to make) we should be calling deleteProperty in this case too.
2107
2108         * bindings/scripts/CodeGeneratorJS.pm:
2109         (GenerateImplementation):
2110             - changed to call deleteProperty instead of removeDirect.
2111         * bindings/scripts/test/JS/JSTestObj.cpp:
2112         (WebCore::JSTestObjPrototype::finishCreation):
2113             - updated bindings test results.
2114
2115 2016-06-08  Nan Wang  <n_wang@apple.com>
2116
2117         For keyboard users, activating a fragment URL should transfer focus and caret to the destination
2118         https://bugs.webkit.org/show_bug.cgi?id=116046
2119
2120         Reviewed by Ryosuke Niwa.
2121
2122         Added a sequential focus navigation starting node to document. When TAB or SHIFT-TAB is pressed
2123         and there is no focused element, we start searching for next focus candidates at the sequential
2124         focus navigation node.
2125         Spec: https://html.spec.whatwg.org/multipage/interaction.html#sequential-focus-navigation-starting-point
2126
2127         Test: fast/events/sequential-focus-navigation-starting-point.html
2128
2129         * dom/Document.cpp:
2130         (WebCore::Document::removedLastRef):
2131         (WebCore::Document::destroyRenderTree):
2132         (WebCore::Document::styleResolverChanged):
2133         (WebCore::isNodeInSubtree):
2134         (WebCore::Document::removeFocusedNodeOfSubtree):
2135         (WebCore::Document::hoveredElementDidDetach):
2136         (WebCore::Document::setFocusedElement):
2137         (WebCore::shouldResetFocusNavigationStartingNode):
2138         (WebCore::Document::setFocusNavigationStartingNode):
2139         (WebCore::Document::focusNavigationStartingNode):
2140         (WebCore::Document::setCSSTarget):
2141         (WebCore::Document::nodeChildrenWillBeRemoved):
2142         (WebCore::Document::nodeWillBeRemoved):
2143         (WebCore::fallbackFocusNavigationStartingNodeAfterRemoval):
2144         (WebCore::Document::removeFocusNavigationNodeOfSubtree):
2145         (WebCore::Document::textInserted):
2146         * dom/Document.h:
2147         (WebCore::Document::userActionElements):
2148         * page/EventHandler.cpp:
2149         (WebCore::EventHandler::handleMousePressEvent):
2150         * page/FocusController.cpp:
2151         (WebCore::FocusController::advanceFocusInDocumentOrder):
2152         * page/FrameView.cpp:
2153         (WebCore::FrameView::scrollToAnchor):
2154
2155 2016-06-08  Eric Carlson  <eric.carlson@apple.com>
2156
2157         HTMLMediaElement.prototype.canPlayType accounting for 250-750ms first loading theverge.com
2158         https://bugs.webkit.org/show_bug.cgi?id=158335
2159         <rdar://problem/26615416>
2160
2161         Reviewed by Brent Fulgham.
2162
2163         * WebCore.xcodeproj/project.pbxproj: Add AVFoundationMIMETypeCache.
2164
2165         * platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.h: Added.
2166         * platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm: Added.
2167         (WebCore::AVFoundationMIMETypeCache::AVFoundationMIMETypeCache):
2168         (WebCore::AVFoundationMIMETypeCache::loadTypes):
2169         (WebCore::AVFoundationMIMETypeCache::types):
2170         (WebCore::AVFoundationMIMETypeCache::singleton):
2171
2172         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2173         (WebCore::MediaPlayerPrivateAVFoundationObjC::registerMediaEngine): Start MIME type loading.
2174         (WebCore::MediaPlayerPrivateAVFoundationObjC::getSupportedTypes): Use AVFoundationMIMETypeCache.
2175         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType): Ditto.
2176         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem): Ditto.
2177         (WebCore::avfMIMETypes): Deleted.
2178
2179         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2180         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::registerMediaEngine): Start MIME type loading.
2181         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isAvailable): Use AVFoundationMIMETypeCache.
2182         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::getSupportedTypes): Ditto.
2183         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType): Ditto.
2184         (WebCore::mimeTypeCache): Deleted.
2185
2186 2016-06-07  Ryosuke Niwa  <rniwa@webkit.org>
2187
2188         REGRESSION (r201667): ASSERTION FAILED: !m_anchorNode || !editingIgnoresContent(*m_anchorNode)
2189         https://bugs.webkit.org/show_bug.cgi?id=158373
2190         <rdar://problem/26690795>
2191
2192         Reviewed by Brent Fulgham.
2193
2194         The bug was caused by VisibleSelection::toNormalizedRange calling parentAnchoredEquivalent on an orphaned Position.
2195         Fixed it by checking that condition and exiting early since we can't create a Range with a detached node anyway.
2196
2197         Also renamed isNonOrphanedCaretOrRange to isNoneOrOrphaned after negating the semantics for clarity.
2198
2199         Test: editing/selection/selection-in-iframe-removed-crash.html
2200
2201         * editing/EditorCommand.cpp:
2202         (WebCore::valueFormatBlock):
2203         * editing/FrameSelection.cpp:
2204         (WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance):
2205         * editing/InsertLineBreakCommand.cpp:
2206         (WebCore::InsertLineBreakCommand::doApply):
2207         * editing/InsertListCommand.cpp:
2208         (WebCore::InsertListCommand::doApply):
2209         * editing/InsertParagraphSeparatorCommand.cpp:
2210         (WebCore::InsertParagraphSeparatorCommand::doApply):
2211         * editing/InsertTextCommand.cpp:
2212         (WebCore::InsertTextCommand::doApply):
2213         * editing/RemoveFormatCommand.cpp:
2214         (WebCore::RemoveFormatCommand::doApply):
2215         * editing/ReplaceSelectionCommand.cpp:
2216         (WebCore::ReplaceSelectionCommand::doApply):
2217         * editing/SetSelectionCommand.cpp:
2218         (WebCore::SetSelectionCommand::doApply):
2219         (WebCore::SetSelectionCommand::doUnapply):
2220         * editing/TypingCommand.cpp:
2221         (WebCore::TypingCommand::doApply):
2222         * editing/VisibleSelection.cpp:
2223         (WebCore::VisibleSelection::firstRange): Also added a check for isNoneOrOrphaned since this function can hit the same
2224         assertion when the selection end points are orphaned.
2225         (WebCore::VisibleSelection::toNormalizedRange): Fixed the bug.
2226         * editing/VisibleSelection.h:
2227         (WebCore::VisibleSelection::isNoneOrOrphaned): Renamed from isNonOrphanedCaretOrRange and negated the semantics.
2228
2229 2016-06-08  Dean Jackson  <dino@apple.com>
2230
2231         Multiple selectors break keyframes animation
2232         https://bugs.webkit.org/show_bug.cgi?id=158199
2233         <rdar://problem/26652591>
2234
2235         Reviewed by Simon Fraser.
2236
2237         If we came across a duplicate key entry in a keyframe, we
2238         were replacing the existing entry, instead of merging.
2239
2240         Test: animations/duplicate-keys.html
2241
2242         * css/CSSKeyframeRule.h:
2243         (WebCore::StyleKeyframe::setKey): Add a way to set the key of a rule
2244         as a number, rather than going through a string and the CSS parser.
2245         * css/StyleResolver.cpp:
2246         (WebCore::StyleResolver::keyframeStylesForAnimation): Check if the rule
2247         has duplicates, and if it does, merge all the common entries.
2248         * rendering/style/KeyframeList.cpp:
2249         (WebCore::KeyframeList::insert): Now that we've removed duplicates at
2250         the processing time, we should never come across a duplicate while
2251         building this list.
2252
2253 2016-06-08  Ryan Haddad  <ryanhaddad@apple.com>
2254
2255         Rebaseline bindings tests after r201808
2256
2257         Unreviewed test gardening.
2258
2259         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
2260         (WebCore::JSTestGlobalObject::finishCreation):
2261         * bindings/scripts/test/JS/JSTestGlobalObject.h:
2262
2263 2016-06-08  Lucas Forschler  <lforschler@apple.com>
2264
2265         Teach cmake about libWebKitSystemInterfaceOSX10.12
2266         
2267         Rubber-stamped by Matt Hanson and Alex Christensen.
2268         
2269         * PlatformMac.cmake:
2270
2271 2016-06-08  Rawinder Singh  <rawinder.singh-webkit@cisra.canon.com.au>
2272
2273         [web-animations] Add Animatable, AnimationEffect, KeyframeEffect and Animation interface
2274         https://bugs.webkit.org/show_bug.cgi?id=156096
2275
2276         Reviewed by Dean Jackson.
2277
2278         Adds:
2279         - Animatable interface and implementation of getAnimations in Element
2280         - Interface and implementation for Document getAnimations method.
2281         - AnimationEffect interface and class stub.
2282         - KeyframeEffect interface and constructor implementation.
2283         - 'Animation' interface, constructor and query methods for effect and timeline.
2284         - Remove runtime condition on Web animation interfaces (compile time flag is specified).
2285
2286         Test: webanimations/Document.html
2287
2288         * CMakeLists.txt:
2289         * DerivedSources.make:
2290         * PlatformGTK.cmake:
2291         * WebCore.xcodeproj/project.pbxproj:
2292         * animation/Animatable.idl: Copied from Source/WebCore/animation/DocumentAnimation.idl.
2293         * animation/AnimationEffect.cpp: Copied from Source/WebCore/animation/AnimationTimeline.cpp.
2294         (WebCore::AnimationEffect::AnimationEffect):
2295         (WebCore::AnimationEffect::~AnimationEffect):
2296         (WebCore::AnimationEffect::setAnimation):
2297         (WebCore::AnimationEffect::isCurrent):
2298         (WebCore::AnimationEffect::isInEffect):
2299         * animation/AnimationEffect.h: Copied from Source/WebCore/animation/DocumentTimeline.cpp.
2300         * animation/AnimationEffect.idl: Copied from Source/WebCore/animation/AnimationTimeline.idl.
2301         * animation/AnimationTimeline.cpp:
2302         (WebCore::AnimationTimeline::destroy):
2303         (WebCore::AnimationTimeline::attachAnimation):
2304         (WebCore::AnimationTimeline::detachAnimation):
2305         * animation/AnimationTimeline.h:
2306         * animation/AnimationTimeline.idl:
2307         * animation/DocumentAnimation.cpp:
2308         (WebCore::DocumentAnimation::timeline):
2309         (WebCore::DocumentAnimation::getAnimations):
2310         (WebCore::DocumentAnimation::addAnimation):
2311         (WebCore::DocumentAnimation::removeAnimation):
2312         * animation/DocumentAnimation.h:
2313         (WebCore::DocumentAnimation::getAnimations):
2314         * animation/DocumentAnimation.idl:
2315         * animation/DocumentTimeline.cpp:
2316         (WebCore::DocumentTimeline::create):
2317         (WebCore::DocumentTimeline::DocumentTimeline):
2318         (WebCore::DocumentTimeline::attach):
2319         (WebCore::DocumentTimeline::detach):
2320         * animation/DocumentTimeline.h:
2321         * animation/DocumentTimeline.idl:
2322         * animation/KeyframeEffect.cpp: Copied from Source/WebCore/animation/DocumentTimeline.cpp.
2323         (WebCore::KeyframeEffect::create):
2324         (WebCore::KeyframeEffect::KeyframeEffect):
2325         (WebCore::KeyframeEffect::~KeyframeEffect):
2326         * animation/KeyframeEffect.h: Copied from Source/WebCore/animation/DocumentTimeline.h.
2327         * animation/KeyframeEffect.idl: Copied from Source/WebCore/animation/AnimationTimeline.idl.
2328         * animation/WebAnimation.cpp: Copied from Source/WebCore/animation/DocumentAnimation.cpp.
2329         (WebCore::WebAnimation::create):
2330         (WebCore::WebAnimation::WebAnimation):
2331         (WebCore::WebAnimation::~WebAnimation):
2332         * animation/WebAnimation.h: Copied from Source/WebCore/animation/DocumentAnimation.h.
2333         * animation/WebAnimation.idl: Copied from Source/WebCore/animation/DocumentTimeline.idl.
2334         * bindings/scripts/CodeGeneratorGObject.pm:
2335         * dom/Element.cpp:
2336         (WebCore::Element::getAnimations):
2337         * dom/Element.h:
2338         * dom/Element.idl:
2339
2340 2016-06-08  Chris Dumez  <cdumez@apple.com>
2341
2342         self.hasOwnProperty() does not work inside Web workers
2343         https://bugs.webkit.org/show_bug.cgi?id=158446
2344         <rdar://problem/26638397>
2345
2346         Reviewed by Geoffrey Garen.
2347
2348         W3C tests for workers were severely broken on WebKit because
2349         self.hasOwnProperty() did not work inside workers. The reason is that
2350         hasOwnProperty() (and other methods like toString()) call toThis() in
2351         StrictMode on thisValue. However, in the case of 'self' in workers,
2352         self was a DedicatedWorkerGlobalScope, which is a JSGlobalObject.
2353         JSGlobalObject::toThis() returns jsUndefined() when called in strict
2354         mode. As a result, we would end up with exceptions such as "undefined
2355         is not an object" when calling self.hasOwnProperty() in workers.
2356
2357         To address the problem, this patch introduces a JSProxy whose proxy
2358         type is PureForwardingProxyType and whose target is the
2359         WorkerGlobalScope. This JSProxy is what we expose to the JavaScript,
2360         instead of the JSWorkerGlobalScope itself. As a result, toThis() now
2361         behaves as expected and self.hasOwnProperty() works inside workers.
2362
2363         This patch greatly improves our pass rate on several W3C tests:
2364         http://w3c-test.org/workers/interfaces.worker: 20 passes -> 50 passes (out of 128)
2365         http://w3c-test.org/IndexedDB/interfaces.worker 0 passes -> 145 passes (out of 156)
2366
2367         Tests: fast/workers/self-hasOwnProperty.html
2368                fast/workers/self-toString.html
2369
2370         * bindings/js/JSWorkerGlobalScopeBase.cpp:
2371         (WebCore::JSWorkerGlobalScopeBase::finishCreation):
2372         (WebCore::JSWorkerGlobalScopeBase::visitChildren):
2373         (WebCore::toJS):
2374         * bindings/js/JSWorkerGlobalScopeBase.h:
2375         (WebCore::JSWorkerGlobalScopeBase::proxy):
2376         * bindings/js/WorkerScriptController.cpp:
2377         (WebCore::WorkerScriptController::initScript):
2378         * bindings/scripts/CodeGeneratorJS.pm:
2379         (GenerateHeader):
2380         (GenerateImplementation):
2381
2382 2016-06-08  Antti Koivisto  <antti@apple.com>
2383
2384         WebKit memory cache doesn't respect Vary header
2385         https://bugs.webkit.org/show_bug.cgi?id=71509
2386         <rdar://problem/26651033>
2387
2388         Reviewed by Sam Weinig.
2389
2390         Implement Vary header support in WebCore memory cache.
2391
2392         The patch moves Vary header code from WebKit2 Network Cache to WebCore and uses it to
2393         verify the headers for CachedResources.
2394
2395         * loader/cache/CachedResource.cpp:
2396         (WebCore::CachedResource::failBeforeStarting):
2397         (WebCore::addAdditionalRequestHeadersToRequest):
2398
2399             Factor into standalone function so we can use it from varyHeaderValuesMatch.
2400
2401         (WebCore::CachedResource::addAdditionalRequestHeaders):
2402         (WebCore::CachedResource::load):
2403         (WebCore::CachedResource::setResponse):
2404
2405             Collect the Vary header values when we receive a response.
2406
2407         (WebCore::CachedResource::responseReceived):
2408         (WebCore::CachedResource::redirectChainAllowsReuse):
2409         (WebCore::CachedResource::varyHeaderValuesMatch):
2410
2411             Test for Vary match.
2412
2413         (WebCore::CachedResource::overheadSize):
2414         * loader/cache/CachedResource.h:
2415         (WebCore::CachedResource::isCacheValidator):
2416         (WebCore::CachedResource::resourceToRevalidate):
2417         * loader/cache/CachedResourceLoader.cpp:
2418         (WebCore::CachedResourceLoader::determineRevalidationPolicy):
2419
2420             Reload on Vary mismatch.
2421
2422         * platform/network/CacheValidation.cpp:
2423         (WebCore::parseCacheControlDirectives):
2424         (WebCore::headerValueForVary):
2425         (WebCore::collectVaryingRequestHeaders):
2426         (WebCore::verifyVaryingRequestHeaders):
2427
2428             Vary header collection and validation code moves here.
2429
2430         * platform/network/CacheValidation.h:
2431
2432 2016-06-08  Commit Queue  <commit-queue@webkit.org>
2433
2434         Unreviewed, rolling out r201800.
2435         https://bugs.webkit.org/show_bug.cgi?id=158518
2436
2437         Missing WebKit2 pieces (Requested by anttik on #webkit).
2438
2439         Reverted changeset:
2440
2441         "WebKit memory cache doesn't respect Vary header"
2442         https://bugs.webkit.org/show_bug.cgi?id=71509
2443         http://trac.webkit.org/changeset/201800
2444
2445 2016-06-06  Antti Koivisto  <antti@apple.com>
2446
2447         WebKit memory cache doesn't respect Vary header
2448         https://bugs.webkit.org/show_bug.cgi?id=71509
2449         <rdar://problem/26651033>
2450
2451         Reviewed by Sam Weinig.
2452
2453         Implement Vary header support in WebCore memory cache.
2454
2455         The patch moves Vary header code from WebKit2 Network Cache to WebCore and uses it to
2456         verify the headers for CachedResources.
2457
2458         * loader/cache/CachedResource.cpp:
2459         (WebCore::CachedResource::failBeforeStarting):
2460         (WebCore::addAdditionalRequestHeadersToRequest):
2461
2462             Factor into standalone function so we can use it from varyHeaderValuesMatch.
2463
2464         (WebCore::CachedResource::addAdditionalRequestHeaders):
2465         (WebCore::CachedResource::load):
2466         (WebCore::CachedResource::setResponse):
2467
2468             Collect the Vary header values when we receive a response.
2469
2470         (WebCore::CachedResource::responseReceived):
2471         (WebCore::CachedResource::redirectChainAllowsReuse):
2472         (WebCore::CachedResource::varyHeaderValuesMatch):
2473
2474             Test for Vary match.
2475
2476         (WebCore::CachedResource::overheadSize):
2477         * loader/cache/CachedResource.h:
2478         (WebCore::CachedResource::isCacheValidator):
2479         (WebCore::CachedResource::resourceToRevalidate):
2480         * loader/cache/CachedResourceLoader.cpp:
2481         (WebCore::CachedResourceLoader::determineRevalidationPolicy):
2482
2483             Reload on Vary mismatch.
2484
2485         * platform/network/CacheValidation.cpp:
2486         (WebCore::parseCacheControlDirectives):
2487         (WebCore::headerValueForVary):
2488         (WebCore::collectVaryingRequestHeaders):
2489         (WebCore::verifyVaryingRequestHeaders):
2490
2491             Vary header collection and validation code moves here.
2492
2493         * platform/network/CacheValidation.h:
2494
2495 2016-06-08  Myles C. Maxfield  <mmaxfield@apple.com>
2496
2497         Extend CSSFontSelector's lifetime to be longer than the Document's lifetime
2498         https://bugs.webkit.org/show_bug.cgi?id=154101
2499
2500         Reviewed by Darin Adler.
2501
2502         Rather than destroying the Document's CSSFontSelector, instead, the object should
2503         live for the lifetime of the document, and it should instead be asked to clear its
2504         contents.
2505
2506         This is important for the CSS Font Loading API, where the identity of objects the
2507         CSSFontSelector references needs to persist throughout the lifetime of the
2508         Document. This patch represents the first step to implementing this correctly.
2509         The second step is for the CSSFontSelector to perform a diff instead of a
2510         wholesale clear of its contents. Once this is done, font loading objects can
2511         survive through a call to Document::clearStyleResolver().
2512
2513         This patch gives the CSSFontSelector two states: building underway and building not
2514         underway. The state is building underway in between calls to clearStyleResolver()
2515         and when the style resolver gets built back up. Otherwise, the state is building
2516         not underway. Because of this new design, creation of all FontFace objects can be
2517         postponed until a state transition from building underway to building not underway.
2518         A subsequent patch will perform the diff at this point. An ASSERT() makes sure that
2519         we never service a font lookup request while Building.
2520
2521         No new tests because there is no behavior change.
2522
2523         * css/CSSFontFaceSet.cpp:
2524         (WebCore::CSSFontFaceSet::clear):
2525         * css/CSSFontSelector.cpp:
2526         (WebCore::CSSFontSelector::buildStarted):
2527         (WebCore::CSSFontSelector::buildCompleted):
2528         (WebCore::CSSFontSelector::addFontFaceRule):
2529         (WebCore::CSSFontSelector::fontRangesForFamily):
2530         (WebCore::CSSFontSelector::CSSFontSelector): Deleted.
2531         (WebCore::CSSFontSelector::clearDocument): Deleted.
2532         * css/CSSFontSelector.h:
2533         * css/StyleResolver.cpp:
2534         (WebCore::StyleResolver::appendAuthorStyleSheets):
2535         * dom/Document.cpp:
2536         (WebCore::Document::Document):
2537         (WebCore::Document::~Document):
2538         (WebCore::Document::clearStyleResolver):
2539         (WebCore::Document::fontSelector): Deleted.
2540         * dom/Document.h:
2541         (WebCore::Document::fontSelector):
2542
2543 2016-06-08  Adam Bergkvist  <adam.bergkvist@ericsson.com>
2544
2545         WebRTC: Imlement MediaEndpointPeerConnection::setLocalDescription()
2546         https://bugs.webkit.org/show_bug.cgi?id=158190
2547
2548         Reviewed by Eric Carlson.
2549
2550         Add implementation for MediaEndpointPeerConnection::setLocalDescription. This function
2551         parses the input SDP, configures the media backend and updates the
2552         RTCPeerConnection state.
2553
2554         This change adds MediaEndpointSessionDescription which is an object representation
2555         of an RTCSessionDescription (which contains an SDP string).
2556
2557         Test: fast/mediastream/RTCPeerConnection-setLocalDescription-offer.html
2558
2559         * CMakeLists.txt:
2560         Add MediaEndpointSessionDescription.
2561         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
2562         (WebCore::hasUnassociatedTransceivers):
2563         (WebCore::MediaEndpointPeerConnection::createOfferTask):
2564         (WebCore::MediaEndpointPeerConnection::setLocalDescription):
2565         (WebCore::MediaEndpointPeerConnection::setLocalDescriptionTask):
2566         Add implementation.
2567         (WebCore::MediaEndpointPeerConnection::localDescription):
2568         (WebCore::MediaEndpointPeerConnection::currentLocalDescription):
2569         (WebCore::MediaEndpointPeerConnection::pendingLocalDescription):
2570         (WebCore::MediaEndpointPeerConnection::localDescriptionTypeValidForState):
2571         (WebCore::MediaEndpointPeerConnection::internalLocalDescription):
2572         (WebCore::MediaEndpointPeerConnection::createRTCSessionDescription):
2573         * Modules/mediastream/MediaEndpointPeerConnection.h:
2574         * Modules/mediastream/MediaEndpointSessionDescription.cpp: Added.
2575         (WebCore::MediaEndpointSessionDescription::create):
2576         (WebCore::MediaEndpointSessionDescription::toRTCSessionDescription):
2577         (WebCore::MediaEndpointSessionDescription::typeString):
2578         (WebCore::MediaEndpointSessionDescription::isLaterThan):
2579         * Modules/mediastream/MediaEndpointSessionDescription.h: Added.
2580         (WebCore::MediaEndpointSessionDescription::~MediaEndpointSessionDescription):
2581         (WebCore::MediaEndpointSessionDescription::type):
2582         (WebCore::MediaEndpointSessionDescription::configuration):
2583         (WebCore::MediaEndpointSessionDescription::MediaEndpointSessionDescription):
2584         * WebCore.xcodeproj/project.pbxproj:
2585         Add MediaEndpointSessionDescription.
2586
2587 2016-06-07  Carlos Garcia Campos  <cgarcia@igalia.com>
2588
2589         [GLIB] Implement hardLinkOrCopyFile() in FileSystemGlib
2590         https://bugs.webkit.org/show_bug.cgi?id=158473
2591
2592         Reviewed by Michael Catanzaro.
2593
2594         It was added in r199230 to be used by IndexedDB blob support, but never implemented for GLib.
2595
2596         * platform/glib/FileSystemGlib.cpp:
2597         (WebCore::hardLinkOrCopyFile):
2598
2599 2016-06-07  Adam Bergkvist  <adam.bergkvist@ericsson.com>
2600
2601         WebRTC: Refactor: Use captures with initializers in MediaEndpointPeerConnection::createOffer()
2602         https://bugs.webkit.org/show_bug.cgi?id=158486
2603
2604         Reviewed by Eric Carlson.
2605
2606         Use initializers for the capture list when scheduling the "create offer task".
2607
2608         No change in behavior.
2609
2610         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
2611         (WebCore::MediaEndpointPeerConnection::createOffer):
2612         (WebCore::WrappedSessionDescriptionPromise::create): Deleted.
2613         (WebCore::WrappedSessionDescriptionPromise::promise): Deleted.
2614         (WebCore::WrappedSessionDescriptionPromise::WrappedSessionDescriptionPromise): Deleted.
2615         Not needed anymore.
2616
2617 2016-06-07  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
2618
2619         TouchList::append() should take a Ref instead of RefPtr
2620         https://bugs.webkit.org/show_bug.cgi?id=158469
2621
2622         Reviewed by Chris Dumez.
2623
2624         RefPtr<Touch> items handled in TouchList cannot be null. Thus
2625         RefPtr<Touch> is replaced by Ref<Touch> objects.
2626
2627         * bindings/js/JSDocumentCustom.cpp:
2628         (WebCore::JSDocument::createTouchList):
2629         * dom/TouchList.cpp:
2630         (WebCore::TouchList::item):
2631         * dom/TouchList.h:
2632         (WebCore::TouchList::append):
2633
2634 2016-06-07  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2635
2636         EFL build has been broken since r201761
2637         https://bugs.webkit.org/show_bug.cgi?id=158512
2638
2639         Unreviewed build fix.
2640
2641         * platform/posix/SharedBufferPOSIX.cpp: 
2642         (WebCore::SharedBuffer::createFromReadingFile):
2643         Do not use ? operand in return line. Additionally return nullptr instead of 0.
2644
2645 2016-06-07  Chris Dumez  <cdumez@apple.com>
2646
2647         Expose Event / EventTarget properties on WorkerGlobalScope
2648         https://bugs.webkit.org/show_bug.cgi?id=158511
2649
2650         Reviewed by Sam Weinig.
2651
2652         Expose Event / EventTarget properties on WorkerGlobalScope, as per the
2653         latest DOM specification:
2654         - https://dom.spec.whatwg.org/#interface-event
2655         - https://dom.spec.whatwg.org/#interface-eventtarget
2656
2657         No new tests, rebaselined existing test.
2658
2659         * dom/Event.idl:
2660         * dom/EventTarget.idl:
2661
2662 2016-06-07  Joonghun Park  <jh718.park@samsung.com>
2663
2664         [EFL] Build fix related with SharedBuffer::createFromReadingFile in SharedBufferPosix.cpp
2665         https://bugs.webkit.org/show_bug.cgi?id=158515
2666
2667         * platform/posix/SharedBufferPOSIX.cpp:
2668         (WebCore::SharedBuffer::createFromReadingFile):
2669
2670 2016-06-07  Mark Lam  <mark.lam@apple.com>
2671
2672         Need an exception check after constructEmptyArray().
2673         https://bugs.webkit.org/show_bug.cgi?id=158411
2674
2675         Reviewed by Saam Barati.
2676
2677         A stress test for this was added in JavaScriptCore.
2678
2679         * bindings/js/IDBBindingUtilities.cpp:
2680         (WebCore::toJS):
2681         * bindings/js/JSCommandLineAPIHostCustom.cpp:
2682         (WebCore::getJSListenerFunctions):
2683         * bindings/js/JSCryptoKeySerializationJWK.cpp:
2684         (WebCore::buildJSONForRSAComponents):
2685         (WebCore::addBoolToJSON):
2686         (WebCore::addUsagesToJSON):
2687         (WebCore::JSCryptoKeySerializationJWK::serialize):
2688         * bindings/js/JSDOMBinding.h:
2689         (WebCore::toJS):
2690         * bindings/js/SerializedScriptValue.cpp:
2691         (WebCore::CloneDeserializer::deserialize):
2692
2693 2016-06-07  Antoine Quint  <graouts@apple.com>
2694
2695         The backdrop-filter property does not respect border-radius
2696         https://bugs.webkit.org/show_bug.cgi?id=158483
2697         <rdar://problem/24210257>
2698
2699         Reviewed by Simon Fraser.
2700
2701         In order to correctly support border-radius and backdrop-filter together, we change
2702         the value set as the m_backdropFiltersRect from a FloatRect to FloatRoundedRect so
2703         that it accounts for values set by the border-radius property. Then we add a new
2704         m_backdropClippingLayer PlatformCALayer member to clip the backdrop layer in the
2705         event that the border-radius is non-zero in updateBackdropFiltersRect(). Finally,
2706         we follow the same pattern used for other PlatformCALayers owned by a GraphicsLayerCA
2707         to support cloning of the new m_backdropClippingLayer.
2708
2709         Tests: css3/filters/backdrop/backdrop-filter-with-border-radius-and-reflection-add.html
2710                css3/filters/backdrop/backdrop-filter-with-border-radius-and-reflection-remove.html
2711                css3/filters/backdrop/backdrop-filter-with-border-radius-and-reflection.html
2712                css3/filters/backdrop/backdrop-filter-with-border-radius-value-change.html
2713                css3/filters/backdrop/backdrop-filter-with-border-radius-value-remove.html
2714                css3/filters/backdrop/backdrop-filter-with-border-radius.html
2715
2716         * platform/graphics/GraphicsLayer.h:
2717         (WebCore::GraphicsLayer::setBackdropFiltersRect):
2718         (WebCore::GraphicsLayer::backdropFiltersRect):
2719         * platform/graphics/ca/GraphicsLayerCA.cpp:
2720         (WebCore::GraphicsLayerCA::willBeDestroyed):
2721         (WebCore::GraphicsLayerCA::setBackdropFiltersRect):
2722         (WebCore::GraphicsLayerCA::updateBackdropFiltersRect):
2723         (WebCore::GraphicsLayerCA::dumpAdditionalProperties):
2724         * platform/graphics/ca/GraphicsLayerCA.h:
2725         * rendering/RenderLayerBacking.cpp:
2726         (WebCore::RenderLayerBacking::updateBackdropFiltersGeometry):
2727         Use a rounded rect if there is no clip and we have non-zero border-radius set on the renderer.
2728
2729 2016-06-07  Andreas Kling  <akling@apple.com>
2730
2731         CachedScript should avoid recomputing its hash multiple times.
2732         <https://webkit.org/b/158506>
2733
2734         Reviewed by Saam Barati.
2735
2736         JSBench was hitting CachedScript::script() hard and spending lots of time hashing scripts.
2737         Since we're already caching the hash in a member variable, don't bother rehashing if we've
2738         already done it before.
2739
2740         This takes total time spent in StringImpl::hashSlowCase() from 1600ms to 77ms on my MBP.
2741
2742         * loader/cache/CachedScript.cpp:
2743         (WebCore::CachedScript::script):
2744
2745 2016-06-07  Keith Rollin  <krollin@apple.com>
2746
2747         Remove all uses of PassRefPtr in WTF
2748         https://bugs.webkit.org/show_bug.cgi?id=157596
2749         <rdar://problem/26234391>
2750
2751         Reviewed by Chris Dumez.
2752
2753         Update calls to interfaces that no longer take or return PassRefPtrs.
2754
2755         No new tests: no new functionality so changes are covered by existing
2756         tests.
2757
2758         * css/CSSPrimitiveValue.cpp:
2759         (WebCore::CSSPrimitiveValue::formatNumberValue):
2760         * dom/Document.cpp:
2761         (WebCore::Document::displayStringModifiedByEncoding):
2762         * xml/XPathGrammar.y:
2763
2764 2016-06-07  Myles C. Maxfield  <mmaxfield@apple.com>
2765
2766         Text-decoration-style: dashed / dotted rendered as solid
2767         https://bugs.webkit.org/show_bug.cgi?id=134336
2768
2769         Reviewed by Dean Jackson.
2770
2771         We already had most of the infrastructure for dotted / dashed underlines.
2772         Previously, we were setting the stroke style for the underlines, but then
2773         filling the underlines (which means the stroke styles is irrelevant).
2774         Instead, we should just compute the individual dots / dashes to fill.
2775
2776         The implementation of this is done inside GraphicsContext because
2777         GraphicsContext is already responsible for handling the single / double
2778         underline distinction. Extending it to be responsible for dotted / dashed
2779         is the natural thing to do.
2780
2781         Tests: fast/css3-text/css3-text-decoration/text-decoration-dashed.html
2782                fast/css3-text/css3-text-decoration/text-decoration-dotted-dashed.html
2783                fast/css3-text/css3-text-decoration/text-decoration-dotted.html
2784
2785         * platform/graphics/GraphicsContext.h:
2786         * platform/graphics/cairo/GraphicsContextCairo.cpp:
2787         (WebCore::GraphicsContext::drawLineForText):
2788         (WebCore::GraphicsContext::drawLinesForText):
2789         * platform/graphics/cg/GraphicsContextCG.cpp:
2790         (WebCore::GraphicsContext::drawLineForText):
2791         (WebCore::GraphicsContext::drawLinesForText):
2792         * rendering/TextDecorationPainter.cpp:
2793         (WebCore::drawSkipInkUnderline):
2794         (WebCore::TextDecorationPainter::paintTextDecoration):
2795
2796 2016-06-07  Chris Fleizach  <cfleizach@apple.com>
2797
2798         AX: iOS: Need to expose whether object is a dialog element
2799         https://bugs.webkit.org/show_bug.cgi?id=158487
2800         <rdar://problem/26678218>
2801
2802         Reviewed by Joanmarie Diggs.
2803
2804         Expose whether an object is a dialog type. This will allow decisions higher up the stack to be made in regards to where to move VoiceOver focus.
2805
2806         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2807         (-[WebAccessibilityObjectWrapper accessibilityIsDialog]):
2808
2809 2016-06-07  Alex Christensen  <achristensen@webkit.org>
2810
2811         Fix Yosemite build.
2812         https://bugs.webkit.org/show_bug.cgi?id=158403
2813
2814         * platform/spi/cocoa/QuartzCoreSPI.h:
2815
2816 2016-06-07  Alex Christensen  <achristensen@webkit.org>
2817
2818         Fix WinCairo build.
2819
2820         * platform/network/curl/MultipartHandle.cpp:
2821         (WebCore::MultipartHandle::didReceiveResponse):
2822
2823 2016-06-07  Alex Christensen  <achristensen@webkit.org>
2824
2825         Build fix non-cocoa platforms.
2826         https://bugs.webkit.org/show_bug.cgi?id=158332
2827
2828         * loader/cache/CachedFont.cpp:
2829         (WebCore::CachedFont::createCustomFontData):
2830         * platform/network/ResourceHandle.cpp:
2831         (WebCore::ResourceHandle::continueWillSendRequest):
2832         * platform/network/curl/MultipartHandle.cpp:
2833         (WebCore::MultipartHandle::didReceiveResponse):
2834         * platform/network/curl/ResourceHandleManager.cpp:
2835         (WebCore::headerCallback):
2836
2837 2016-06-07  Sam Weinig  <sam@webkit.org>
2838
2839         Try to fix the 10.10 build.
2840
2841         * platform/spi/cocoa/QuartzCoreSPI.h:
2842
2843 2016-06-06  Alex Christensen  <achristensen@webkit.org>
2844
2845         Modernize loading code
2846         https://bugs.webkit.org/show_bug.cgi?id=158332
2847
2848         Reviewed by Darin Adler.
2849
2850         No new tests, no change in behavior.
2851
2852         * inspector/InspectorPageAgent.cpp:
2853         (WebCore::InspectorPageAgent::cachedResourceContent):
2854         * loader/DocumentLoader.cpp:
2855         (WebCore::DocumentLoader::continueAfterContentPolicy):
2856         * loader/FrameLoader.h:
2857         * loader/NetscapePlugInStreamLoader.cpp:
2858         (WebCore::NetscapePlugInStreamLoader::didReceiveData):
2859         (WebCore::NetscapePlugInStreamLoader::didReceiveBuffer):
2860         (WebCore::NetscapePlugInStreamLoader::didReceiveDataOrBuffer):
2861         (WebCore::NetscapePlugInStreamLoader::didFinishLoading):
2862         * loader/NetscapePlugInStreamLoader.h:
2863         * loader/ResourceLoader.cpp:
2864         (WebCore::ResourceLoader::deliverResponseAndData):
2865         (WebCore::ResourceLoader::loadDataURL):
2866         (WebCore::ResourceLoader::addDataOrBuffer):
2867         (WebCore::ResourceLoader::clearResourceData):
2868         (WebCore::ResourceLoader::didReceiveData):
2869         (WebCore::ResourceLoader::didReceiveBuffer):
2870         (WebCore::ResourceLoader::didReceiveDataOrBuffer):
2871         (WebCore::ResourceLoader::didFinishLoading):
2872         * loader/ResourceLoader.h:
2873         (WebCore::ResourceLoader::wasCancelled):
2874         (WebCore::ResourceLoader::options):
2875         * loader/SubresourceLoader.cpp:
2876         (WebCore::SubresourceLoader::didReceiveData):
2877         (WebCore::SubresourceLoader::didReceiveBuffer):
2878         (WebCore::SubresourceLoader::didReceiveDataOrBuffer):
2879         * loader/SubresourceLoader.h:
2880         * loader/appcache/ApplicationCacheGroup.cpp:
2881         (WebCore::ApplicationCacheGroup::abort):
2882         (WebCore::ApplicationCacheGroup::createResourceHandle):
2883         * loader/appcache/ApplicationCacheGroup.h:
2884         * loader/cache/CachedImage.cpp:
2885         (WebCore::CachedImage::addData):
2886         * loader/cache/CachedRawResourceClient.h:
2887         * platform/SharedBuffer.cpp:
2888         (WebCore::SharedBuffer::SharedBuffer):
2889         (WebCore::SharedBuffer::createWithContentsOfFile):
2890         (WebCore::SharedBuffer::adoptVector):
2891         (WebCore::SharedBuffer::duplicateDataBufferIfNecessary):
2892         (WebCore::SharedBuffer::appendToDataBuffer):
2893         (WebCore::SharedBuffer::clearDataBuffer):
2894         * platform/SharedBuffer.h:
2895         (WebCore::SharedBuffer::create):
2896         * platform/cf/SharedBufferCF.cpp:
2897         (WebCore::SharedBuffer::SharedBuffer):
2898         (WebCore::SharedBuffer::maybeAppendPlatformData):
2899         (WebCore::SharedBuffer::wrapCFDataArray):
2900         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2901         (ResourceHandleStreamingClient::didReceiveData):
2902         (ResourceHandleStreamingClient::didReceiveBuffer):
2903         * platform/mac/SharedBufferMac.mm:
2904         (WebCore::SharedBuffer::createCFData):
2905         (WebCore::SharedBuffer::createFromReadingFile):
2906         * platform/network/BlobRegistryImpl.cpp:
2907         (WebCore::BlobRegistryImpl::~BlobRegistryImpl):
2908         (WebCore::createBlobResourceHandle):
2909         (WebCore::loadBlobResourceSynchronously):
2910         (WebCore::registerBlobResourceHandleConstructor):
2911         (WebCore::BlobRegistryImpl::createResourceHandle):
2912         (WebCore::BlobRegistryImpl::appendStorageItems):
2913         (WebCore::createResourceHandle): Deleted.
2914         (WebCore::loadResourceSynchronously): Deleted.
2915         * platform/network/BlobRegistryImpl.h:
2916         * platform/network/BlobResourceHandle.cpp:
2917         (WebCore::BlobResourceHandle::createAsync):
2918         (WebCore::BlobResourceHandle::loadResourceSynchronously):
2919         Removed the overridden didReceiveData and didFinishLoading, 
2920         which did nothing and were identical to the function they overwrote.
2921         * platform/network/BlobResourceHandle.h:
2922         * platform/network/PingHandle.h:
2923         * platform/network/ResourceHandle.cpp:
2924         (WebCore::ResourceHandle::ResourceHandle):
2925         (WebCore::ResourceHandle::create):
2926         (WebCore::ResourceHandle::scheduleFailure):
2927         * platform/network/ResourceHandle.h:
2928         * platform/network/ResourceHandleClient.cpp:
2929         (WebCore::ResourceHandleClient::willCacheResponseAsync):
2930         (WebCore::ResourceHandleClient::didReceiveBuffer):
2931         * platform/network/ResourceHandleClient.h:
2932         (WebCore::ResourceHandleClient::didReceiveResponse):
2933         (WebCore::ResourceHandleClient::didReceiveData):
2934         (WebCore::ResourceHandleClient::didFinishLoading):
2935         (WebCore::ResourceHandleClient::didFail):
2936         * platform/network/cocoa/WebCoreNSURLSession.mm:
2937         (-[WebCoreNSURLSessionDataTask resource:receivedData:length:]):
2938         This data must be copied in order to put it in a refcounted NSData because it comes
2939         from IPC from the Network Process and is an IPC::DataReference which will be deallocated
2940         when the message handling is done.
2941         * platform/soup/SharedBufferSoup.cpp:
2942         (WebCore::SharedBuffer::SharedBuffer):
2943         * testing/MockContentFilter.cpp:
2944         (WebCore::MockContentFilter::replacementData):
2945         (WebCore::MockContentFilter::unblockHandler):
2946
2947 2016-06-06  Sam Weinig  <sam@webkit.org>
2948
2949         Add experimental support for spring based CSS animations
2950         https://bugs.webkit.org/show_bug.cgi?id=158403
2951
2952         Reviewed by Dean Jackson.
2953
2954         Adds experimental support for a new CSS animation timing function that uses
2955         spring to model the time function. To use it you replace your normal timing
2956         function, be it cubic-bezier or steps, with a new function called spring().
2957         For instance, for a transition you would write:
2958
2959             transition-timing-function: spring(1 100 10 0);
2960         
2961         The parameters are, in order:
2962             - Mass
2963             - Stiffness
2964             - Damping
2965             - Initial Velocity
2966
2967         Tests: animations/spring-computed-style.html
2968                animations/spring-function.html
2969                animations/spring-parsing.html
2970
2971         * WebCore.xcodeproj/project.pbxproj:
2972         Add new file.
2973
2974         * css/CSSComputedStyleDeclaration.cpp:
2975         (WebCore::createTimingFunctionValue):
2976         Modernize and add support for the spring function.
2977
2978         * css/CSSParser.cpp:
2979         (WebCore::CSSParserContext::CSSParserContext):
2980         (WebCore::operator==):
2981         (WebCore::CSSParser::CSSParser):
2982         (WebCore::CSSParser::parseTransformOriginShorthand):
2983         (WebCore::CSSParser::isSpringTimingFunctionEnabled):
2984         (WebCore::CSSParser::parseCubicBezierTimingFunctionValue):
2985         (WebCore::CSSParser::parseSpringTimingFunctionValue):
2986         (WebCore::CSSParser::parseAnimationTimingFunction):
2987         * css/CSSParser.h:
2988         * css/CSSParserMode.h:
2989         Add parsing support for the spring() function.
2990
2991         * css/CSSTimingFunctionValue.cpp:
2992         (WebCore::CSSCubicBezierTimingFunctionValue::customCSSText):
2993         (WebCore::CSSCubicBezierTimingFunctionValue::equals):
2994         (WebCore::CSSStepsTimingFunctionValue::customCSSText):
2995         (WebCore::CSSStepsTimingFunctionValue::equals):
2996         (WebCore::CSSSpringTimingFunctionValue::customCSSText):
2997         (WebCore::CSSSpringTimingFunctionValue::equals):
2998         * css/CSSTimingFunctionValue.h:
2999         (WebCore::CSSSpringTimingFunctionValue::create):
3000         (WebCore::CSSSpringTimingFunctionValue::mass):
3001         (WebCore::CSSSpringTimingFunctionValue::stiffness):
3002         (WebCore::CSSSpringTimingFunctionValue::damping):
3003         (WebCore::CSSSpringTimingFunctionValue::initialVelocity):
3004         (WebCore::CSSSpringTimingFunctionValue::CSSSpringTimingFunctionValue):
3005         Modernize and add support for the spring function.
3006
3007         * css/CSSToStyleMap.cpp:
3008         (WebCore::CSSToStyleMap::mapAnimationTimingFunction):
3009         Pipe the spring function into the animation.
3010
3011         * css/CSSValue.cpp:
3012         (WebCore::CSSValue::equals):
3013         (WebCore::CSSValue::cssText):
3014         (WebCore::CSSValue::destroy):
3015         * css/CSSValue.h:
3016         (WebCore::CSSValue::isSpringTimingFunctionValue):
3017         Add support for the spring function.
3018         
3019         * page/Settings.in:
3020         Add a setting to control if the spring function is enabled.
3021
3022         * page/animation/AnimationBase.cpp:
3023         (WebCore::solveSpringFunction):
3024         (WebCore::AnimationBase::progress):
3025         Add support for solving the spring function. Since the spring requires time to be absolute,
3026         get the real time by multiplying the ratio t, to the total duration.
3027
3028         * platform/animation/TimingFunction.cpp:
3029         (WebCore::operator<<):
3030         * platform/animation/TimingFunction.h:
3031         (WebCore::TimingFunction::~TimingFunction):
3032         (WebCore::TimingFunction::isSpringTimingFunction):
3033         Add support for the spring timing function.
3034
3035         * platform/graphics/SpringSolver.h: Added.
3036         (WebCore::SpringSolver::SpringSolver):
3037         (WebCore::SpringSolver::solve):
3038         Add a Spring solver that matches the one in CoreAnimation.
3039
3040         * platform/graphics/ca/GraphicsLayerCA.cpp:
3041         (WebCore::GraphicsLayerCA::createAnimationFromKeyframes):
3042         (WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
3043         (WebCore::GraphicsLayerCA::createBasicAnimation):
3044         (WebCore::GraphicsLayerCA::createSpringAnimation):
3045         (WebCore::GraphicsLayerCA::setupAnimation):
3046         * platform/graphics/ca/GraphicsLayerCA.h:
3047         Map animations with spring timing functions to CASpringAnimations.
3048
3049         * platform/graphics/ca/PlatformCAAnimation.cpp:
3050         (WebCore::operator<<):
3051         (WebCore::PlatformCAAnimation::isBasicAnimation):
3052         * platform/graphics/ca/PlatformCAAnimation.h:
3053         (WebCore::PlatformCAAnimation::setActualStartTimeIfNeeded):
3054         (WebCore::PlatformCAAnimation::PlatformCAAnimation):
3055         * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm:
3056         (WebCore::toCAMediaTimingFunction):
3057         (PlatformCAAnimationCocoa::PlatformCAAnimationCocoa):
3058         (PlatformCAAnimationCocoa::setTimingFunction):
3059         (PlatformCAAnimationCocoa::copyTimingFunctionFrom):
3060         (PlatformCAAnimationCocoa::setFromValue):
3061         (PlatformCAAnimationCocoa::copyFromValueFrom):
3062         (PlatformCAAnimationCocoa::setToValue):
3063         (PlatformCAAnimationCocoa::copyToValueFrom):
3064         Add a new type of PlatformCAAnimation, Spring, which is a sub-type of Basic.
3065
3066 2016-06-05  Sam Weinig  <sam@webkit.org>
3067
3068         Add experimental support for spring based CSS animations
3069         https://bugs.webkit.org/show_bug.cgi?id=158403
3070
3071         Reviewed by Dean Jackson.
3072
3073         Adds experimental support for a new CSS animation timing function that uses
3074         spring to model the time function. To use it you replace your normal timing
3075         function, be it cubic-bezier or steps, with a new function called spring().
3076         For instance, for a transition you would write:
3077
3078             transition-timing-function: spring(1 100 10 0);
3079         
3080         The parameters are, in order:
3081             - Mass
3082             - Stiffness
3083             - Damping
3084             - Initial Velocity
3085
3086         Tests: animations/spring-computed-style.html
3087                animations/spring-function.html
3088                animations/spring-parsing.html
3089
3090         * WebCore.xcodeproj/project.pbxproj:
3091         Add new file.
3092
3093         * css/CSSComputedStyleDeclaration.cpp:
3094         (WebCore::createTimingFunctionValue):
3095         Modernize and add support for the spring function.
3096
3097         * css/CSSParser.cpp:
3098         (WebCore::CSSParserContext::CSSParserContext):
3099         (WebCore::operator==):
3100         (WebCore::CSSParser::CSSParser):
3101         (WebCore::CSSParser::parseTransformOriginShorthand):
3102         (WebCore::CSSParser::isSpringTimingFunctionEnabled):
3103         (WebCore::CSSParser::parseCubicBezierTimingFunctionValue):
3104         (WebCore::CSSParser::parseSpringTimingFunctionValue):
3105         (WebCore::CSSParser::parseAnimationTimingFunction):
3106         * css/CSSParser.h:
3107         * css/CSSParserMode.h:
3108         Add parsing support for the spring() function.
3109
3110         * css/CSSTimingFunctionValue.cpp:
3111         (WebCore::CSSCubicBezierTimingFunctionValue::customCSSText):
3112         (WebCore::CSSCubicBezierTimingFunctionValue::equals):
3113         (WebCore::CSSStepsTimingFunctionValue::customCSSText):
3114         (WebCore::CSSStepsTimingFunctionValue::equals):
3115         (WebCore::CSSSpringTimingFunctionValue::customCSSText):
3116         (WebCore::CSSSpringTimingFunctionValue::equals):
3117         * css/CSSTimingFunctionValue.h:
3118         (WebCore::CSSSpringTimingFunctionValue::create):
3119         (WebCore::CSSSpringTimingFunctionValue::mass):
3120         (WebCore::CSSSpringTimingFunctionValue::stiffness):
3121         (WebCore::CSSSpringTimingFunctionValue::damping):
3122         (WebCore::CSSSpringTimingFunctionValue::initialVelocity):
3123         (WebCore::CSSSpringTimingFunctionValue::CSSSpringTimingFunctionValue):
3124         Modernize and add support for the spring function.
3125
3126         * css/CSSToStyleMap.cpp:
3127         (WebCore::CSSToStyleMap::mapAnimationTimingFunction):
3128         Pipe the spring function into the animation.
3129
3130         * css/CSSValue.cpp:
3131         (WebCore::CSSValue::equals):
3132         (WebCore::CSSValue::cssText):
3133         (WebCore::CSSValue::destroy):
3134         * css/CSSValue.h:
3135         (WebCore::CSSValue::isSpringTimingFunctionValue):
3136         Add support for the spring function.
3137         
3138         * page/Settings.in:
3139         Add a setting to control if the spring function is enabled.
3140
3141         * page/animation/AnimationBase.cpp:
3142         (WebCore::solveSpringFunction):
3143         (WebCore::AnimationBase::progress):
3144         Add support for solving the spring function. Since the spring requires time to be absolute,
3145         get the real time by multiplying the ratio t, to the total duration.
3146
3147         * platform/animation/TimingFunction.cpp:
3148         (WebCore::operator<<):
3149         * platform/animation/TimingFunction.h:
3150         (WebCore::TimingFunction::~TimingFunction):
3151         (WebCore::TimingFunction::isSpringTimingFunction):
3152         Add support for the spring timing function.
3153
3154         * platform/graphics/SpringSolver.h: Added.
3155         (WebCore::SpringSolver::SpringSolver):
3156         (WebCore::SpringSolver::solve):
3157         Add a Spring solver that matches the one in CoreAnimation.
3158
3159         * platform/graphics/ca/GraphicsLayerCA.cpp:
3160         (WebCore::GraphicsLayerCA::createAnimationFromKeyframes):
3161         (WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
3162         (WebCore::GraphicsLayerCA::createBasicAnimation):
3163         (WebCore::GraphicsLayerCA::createSpringAnimation):
3164         (WebCore::GraphicsLayerCA::setupAnimation):
3165         * platform/graphics/ca/GraphicsLayerCA.h:
3166         Map animations with spring timing functions to CASpringAnimations.
3167
3168         * platform/graphics/ca/PlatformCAAnimation.cpp:
3169         (WebCore::operator<<):
3170         (WebCore::PlatformCAAnimation::isBasicAnimation):
3171         * platform/graphics/ca/PlatformCAAnimation.h:
3172         (WebCore::PlatformCAAnimation::setActualStartTimeIfNeeded):
3173         (WebCore::PlatformCAAnimation::PlatformCAAnimation):
3174         * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm:
3175         (WebCore::toCAMediaTimingFunction):
3176         (PlatformCAAnimationCocoa::PlatformCAAnimationCocoa):
3177         (PlatformCAAnimationCocoa::setTimingFunction):
3178         (PlatformCAAnimationCocoa::copyTimingFunctionFrom):
3179         (PlatformCAAnimationCocoa::setFromValue):
3180         (PlatformCAAnimationCocoa::copyFromValueFrom):
3181         (PlatformCAAnimationCocoa::setToValue):
3182         (PlatformCAAnimationCocoa::copyToValueFrom):
3183         Add a new type of PlatformCAAnimation, Spring, which is a sub-type of Basic.
3184
3185 2016-06-07  Chris Dumez  <cdumez@apple.com>
3186
3187         Implement EventListenerOptions argument to addEventListener
3188         https://bugs.webkit.org/show_bug.cgi?id=149466
3189         <rdar://problem/22802031>
3190
3191         Reviewed by Dean Jackson.
3192
3193         Implement AddEventListenerOptions dictionary argument to addEventListener()
3194         and EventListenerOptions dictionary argument to removeEventListener(), as
3195         per the latest DOM specification:
3196         - https://dom.spec.whatwg.org/#interface-eventtarget
3197
3198         Firefox and Chrome already support this.
3199
3200         Support for AddEventListenerOptions in this patch is as follows:
3201         - 'capture': fully supported.
3202         - 'once': fully supported.
3203         - 'passive': supported in the sense that preventDefault() will be ignored
3204                      for passive event listeners. There are however currently no
3205                      performance benefits from passing this flag. Those optimizations
3206                      will be implemented in follow-up patches (in particular for
3207                      Touch and Scroll events).
3208
3209         Tests: fast/events/AddEventListenerOptions-once-recursive.html
3210                fast/events/AddEventListenerOptions-once.html
3211                fast/events/AddEventListenerOptions-passive.html
3212                fast/events/removeEventListener-EventListenerOptions-capture.html
3213                imported/w3c/web-platform-tests/dom/events/EventListenerOptions-capture.html
3214
3215         * Modules/webaudio/AudioScheduledSourceNode.cpp:
3216         (WebCore::AudioScheduledSourceNode::addEventListener):
3217         (WebCore::AudioScheduledSourceNode::removeEventListener):
3218         * Modules/webaudio/AudioScheduledSourceNode.h:
3219         * Modules/webaudio/ScriptProcessorNode.cpp:
3220         (WebCore::ScriptProcessorNode::addEventListener):
3221         (WebCore::ScriptProcessorNode::removeEventListener):
3222         * Modules/webaudio/ScriptProcessorNode.h:
3223         * bindings/scripts/CodeGeneratorJS.pm:
3224         (GenerateParametersCheckExpression):
3225         * dom/Event.h:
3226         (WebCore::Event::preventDefault):
3227         (WebCore::Event::setInPassiveListener):
3228         * dom/EventListenerMap.cpp:
3229         (WebCore::addListenerToVector):
3230         (WebCore::EventListenerMap::add):
3231         * dom/EventListenerMap.h:
3232         * dom/EventTarget.cpp:
3233         (WebCore::EventTarget::addEventListener):
3234         (WebCore::EventTarget::addEventListenerForBindings):
3235         (WebCore::EventTarget::removeEventListenerForBindings):
3236         (WebCore::EventTarget::removeEventListener):
3237         (WebCore::EventTarget::setAttributeEventListener):
3238         (WebCore::EventTarget::fireEventListeners):
3239         * dom/EventTarget.h:
3240         (WebCore::EventTarget::ListenerOptions::ListenerOptions):
3241         (WebCore::EventTarget::AddEventListenerOptions::AddEventListenerOptions):
3242         (WebCore::EventTarget::addEventListener):
3243         (WebCore::EventTarget::addEventListenerForBindings):
3244         (WebCore::EventTarget::removeEventListenerForBindings):
3245         * dom/EventTarget.idl:
3246         * dom/MessagePort.cpp:
3247         (WebCore::MessagePort::addEventListener):
3248         * dom/MessagePort.h:
3249         * dom/Node.cpp:
3250         (WebCore::tryAddEventListener):
3251         (WebCore::Node::addEventListener):
3252         (WebCore::tryRemoveEventListener):
3253         (WebCore::Node::removeEventListener):
3254         * dom/Node.h:
3255         * dom/RegisteredEventListener.h:
3256         (WebCore::RegisteredEventListener::Options::Options):
3257         (WebCore::RegisteredEventListener::RegisteredEventListener):
3258         (WebCore::operator==):
3259         * html/HTMLMediaElement.cpp:
3260         (WebCore::HTMLMediaElement::addEventListener):
3261         (WebCore::HTMLMediaElement::removeEventListener):
3262         * html/HTMLMediaElement.h:
3263         * page/DOMWindow.cpp:
3264         (WebCore::DOMWindow::addEventListener):
3265         (WebCore::DOMWindow::removeEventListener):
3266         * page/DOMWindow.h:
3267         * svg/SVGElement.cpp:
3268         (WebCore::SVGElement::addEventListener):
3269         (WebCore::SVGElement::removeEventListener):
3270         * svg/SVGElement.h:
3271
3272 2016-06-07  Brent Fulgham  <bfulgham@apple.com>
3273
3274         CSP: Content Security Policy directive, upgrade-insecure-requests (UIR)
3275         https://bugs.webkit.org/show_bug.cgi?id=143653
3276         <rdar://problem/23032067>
3277
3278         Reviewed by Andy Estes.
3279
3280         Modify our loading logic so that we recognize and upgrade insecure requests to secure
3281         requests if the Content Security Policy directive 'upgrade-insecure-requests' is
3282         present.
3283         
3284         Add a static helper function to ContentSecurityPolicy to upgrade insecure URLs so
3285         that we don't have to sprinkle the same code all over the loader system.
3286
3287         Tests: http/tests/security/contentSecurityPolicy/report-only-upgrade-insecure.php
3288                http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/basic-upgrade-cors.https.html
3289                http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/basic-upgrade.https.html
3290                http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/form-upgrade.html
3291                http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/https-header-auxiliary.html
3292                http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/https-header-nested.html
3293                http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/https-header-subresource.html
3294                http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/https-header-top-level.html
3295                http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/iframe-upgrade.https.html
3296                http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/proper-nested-upgrades.html
3297                http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/proper-open-window-upgrades.html
3298                http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/upgrade-insecure-audio-video-in-main-frame.html
3299                http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/upgrade-insecure-css-in-iframe.html
3300                http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/upgrade-insecure-image-in-main-frame.html
3301                http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/upgrade-simple-ws.html
3302                http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/upgrade-insecure-xhr-in-main-frame.html
3303                http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/upgrade-redirect-http-to-https-script-in-iframe.html
3304                http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/upgrade-redirect-https-to-http-script-in-iframe.html
3305                http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/upgrades-mixed-content.html
3306                http/tests/ssl/iframe-upgrade.https.html
3307                http/tests/ssl/upgrade-origin-usage.html
3308                http/tests/websocket/tests/hybi/upgrade-simple-ws.html
3309
3310         * Modules/websockets/WebSocket.cpp:
3311         (WebCore::WebSocket::connect): Upgrade insecure requests if the CSP
3312         indicates we should.
3313         * dom/Document.cpp:
3314         (WebCore::Document::initSecurityContext): Populate new document CSP with sets of upgrade host and port combinations.
3315         * dom/ScriptElement.cpp:
3316         (WebCore::ScriptElement::requestScript): Upgrade insecure requests if
3317         the CSP indicates we should.
3318         * html/HTMLMediaElement.cpp:
3319         (WebCore::HTMLMediaElement::loadResource): Ditto.
3320         * loader/DocumentWriter.cpp:
3321         (WebCore::DocumentWriter::begin): Ditto.
3322         * loader/FormSubmission.cpp:
3323         (WebCore::FormSubmission::create): Ditto.
3324         (WebCore::FormSubmission::populateFrameLoadRequest): Add "Upgrade-Insecure-Requests"
3325         header to frame load requests.
3326         * loader/FrameLoader.cpp:
3327         (WebCore::FrameLoader::addExtraFieldsToMainResourceRequest): Add the
3328         'Update-Insecure-Requests' header field if necessary.
3329         (WebCore::FrameLoader::addHTTPUpgradeInsecureRequestsIfNeeded): Added helper function.
3330         (WebCore::FrameLoader::loadPostRequest): Upgrade insecure requests if the CSP
3331         indicates we should.
3332         (WebCore::FrameLoader::loadResourceSynchronously): Ditto.
3333         (WebCore::FrameLoader::loadDifferentDocumentItem): If loading a form, add the
3334         'Update-Insecure-Requests' header field if necessary.
3335         (WebCore::createWindow): Upgrade insecure requests if the CSP
3336         indicates we should.
3337         * loader/FrameLoader.h:
3338         * loader/PingLoader.cpp:
3339         (WebCore::PingLoader::loadImage): Upgrade insecure requests if the CSP
3340         indicates we should.
3341         (WebCore::PingLoader::sendPing): Ditto.
3342         (WebCore::PingLoader::sendViolationReport): Ditto.
3343         * loader/ResourceLoader.cpp:
3344         (WebCore::ResourceLoader::willSendRequestInternal): Ditto.
3345         * loader/SubframeLoader.cpp:
3346         (WebCore::SubframeLoader::requestFrame): Ditto.
3347         (WebCore::SubframeLoader::requestObject): Ditto.
3348         * loader/appcache/ApplicationCacheHost.cpp:
3349         (WebCore::ApplicationCacheHost::shouldLoadResourceFromApplicationCache): Ditto.
3350         * loader/cache/CachedResourceLoader.cpp:
3351         (WebCore::CachedResourceLoader::requestImage): Ditto.
3352         (WebCore::CachedResourceLoader::requestResource): Ditto.
3353         * page/DOMWindow.cpp:
3354         (WebCore::DOMWindow::createWindow): Add the 'Update-Insecure-Requests' header
3355         field if necessary.
3356         * page/csp/ContentSecurityPolicy.cpp:
3357         (WebCore::ContentSecurityPolicy::copyStateFrom): Populate upgraded resource set
3358         from other context.
3359         (WebCore::ContentSecurityPolicy::upgradeInsecureRequestIfNeeded): Added helper function
3360         to upgrade requests when the upgrade-insecure-requests CSP policy is present, or if
3361         the host and port combination have previously been upgraded.
3362         (WebCore::ContentSecurityPolicy::upgradeInsecureNavigationRequestIfNeeded): Added
3363         helper function to upgrade requests that have been previously upgraded. Cross-site
3364         navigations only get upgraded when they have been previously upgraded.
3365         (WebCore::ContentSecurityPolicy::addInsecureNavigationRequestsToUpgrade): Added.
3366         (WebCore::ContentSecurityPolicy::populateInsecureNavigationRequestsToUpgradeFromOther): Added.
3367         * page/csp/ContentSecurityPolicy.h:
3368         (WebCore::ContentSecurityPolicy::setUpgradeInsecureRequests): Added.
3369         (WebCore::ContentSecurityPolicy::upgradeInsecureRequests): Added.
3370         * page/csp/ContentSecurityPolicyDirectiveList.cpp:
3371         (WebCore::ContentSecurityPolicyDirectiveList::ContentSecurityPolicyDirectiveList): Use
3372         more C++11 initializations.
3373         (WebCore::ContentSecurityPolicyDirectiveList::setUpgradeInsecureRequests): Added.
3374         (WebCore::ContentSecurityPolicyDirectiveList::addDirective): Teach this function to
3375         recognize the new directive.
3376         * page/csp/ContentSecurityPolicyDirectiveList.h:
3377         * page/csp/ContentSecurityPolicyDirectiveNames.cpp:
3378         * page/csp/ContentSecurityPolicyDirectiveNames.h:
3379         * platform/network/HTTPHeaderNames.in: Add new 'Upgrade-Insecure-Requests' header field.
3380         * xml/XMLHttpRequest.cpp:
3381         (WebCore::XMLHttpRequest::open): Upgrade insecure requests if the CSP if needed.
3382
3383 2016-06-07  Fujii Hironori  <Hironori.Fujii@sony.com>
3384
3385         Video elements are painted twice, in PaintPhaseForeground and PaintPhaseSelfOutline
3386         https://bugs.webkit.org/show_bug.cgi?id=158247
3387
3388         Reviewed by Simon Fraser.
3389
3390         Test: fast/replaced/outline-replaced-elements-offset.html
3391
3392         In <http://trac.webkit.org/changeset/105247>,
3393         RenderReplaced::paint was changed to call
3394         RenderReplaced::paintReplaced in PaintPhaseOutline and
3395         PaintPhaseSelfOutline to paint outline of SVG.
3396
3397         As the result, RenderVideo::paintReplaced paints twice,
3398         in forground and outline phase.
3399
3400         It was changed to paint outline of SVG in PaintPhaseForeground
3401         since <http://trac.webkit.org/changeset/168645>.  No need to call
3402         RenderReplaced::paintReplaced in outline phases anymore.
3403
3404         * rendering/RenderReplaced.cpp:
3405         (WebCore::RenderReplaced::paint): Return early if
3406         PaintPhaseOutline or PaintPhaseSelfOutline.
3407         Return early unless PaintPhaseForeground nor PaintPhaseSelection,
3408         even if canHaveChildren().
3409
3410 2016-06-07  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
3411
3412         Creating a TouchList with non Touch items should throw an exception
3413         https://bugs.webkit.org/show_bug.cgi?id=158302
3414
3415         Reviewed by Youenn Fablet.
3416
3417         Only Touch items should be passed to CreateTouchList function as per specification
3418         (https://w3c.github.io/touch-events/#extensions-to-the-document-interface).
3419         CreateTouchList function behavior is modified. An exception is thrown when non Touch items
3420         are passed as parameters instead of adding null items in the TouchList.
3421
3422         Tests have been modified to check whether behavior of CreateTouchList is correct.
3423
3424         * bindings/js/JSDocumentCustom.cpp:
3425         (WebCore::JSDocument::createTouchList):
3426         * dom/Document.idl:
3427
3428 2016-06-06  Commit Queue  <commit-queue@webkit.org>
3429
3430         Unreviewed, rolling out r201735.
3431         https://bugs.webkit.org/show_bug.cgi?id=158465
3432
3433         fast/events/AddEventListenerOptions-once-recursive.html fails
3434         on all bots (Requested by ap on #webkit).
3435
3436         Reverted changeset:
3437
3438         "Implement EventListenerOptions argument to addEventListener"
3439         https://bugs.webkit.org/show_bug.cgi?id=149466
3440         http://trac.webkit.org/changeset/201735
3441
3442 2016-06-06  Commit Queue  <commit-queue@webkit.org>
3443
3444         Unreviewed, rolling out r201679.
3445         https://bugs.webkit.org/show_bug.cgi?id=158464
3446
3447         http/tests/websocket/tests/hybi/upgrade-simple-ws.html is
3448         flaky (Requested by ap on #webkit).
3449
3450         Reverted changeset:
3451
3452         "CSP: Content Security Policy directive, upgrade-insecure-
3453         requests (UIR)"
3454         https://bugs.webkit.org/show_bug.cgi?id=143653
3455         http://trac.webkit.org/changeset/201679
3456
3457 2016-06-06  Jiewen Tan  <jiewen_tan@apple.com>
3458
3459         URLs containing tabs or newlines are parsed incorrectly
3460         https://bugs.webkit.org/show_bug.cgi?id=143381
3461         <rdar://problem/26567214>
3462
3463         Reviewed by Brent Fulgham.
3464
3465         1. Strip any tabs and newlines in the URL input.
3466         2. Replace the original stripping URL leading and trailing white spaces logic with WTFString's
3467         builtin, and move this logic to the very begining of the URL parser.
3468         3. Enhance the protocolIs method to ignore any leading whitespace/control characters, and
3469         tabs/newlines of the examining url.
3470
3471         Test: fast/url/tab-and-newline-stripping.html
3472
3473         * platform/URL.cpp:
3474         (WebCore::isTabNewline):
3475         (WebCore::shouldTrimFromURL):
3476         (WebCore::URL::init):
3477         (WebCore::protocolIs):
3478
3479 2016-06-02  Ryosuke Niwa  <rniwa@webkit.org>
3480
3481         Update the list of elements attachShadow is allowed
3482         https://bugs.webkit.org/show_bug.cgi?id=157706
3483
3484         Reviewed by Darin Adler.
3485
3486         Update the list of elements on which attachShadow is allowed per the latest shadow DOM spec:
3487         http://www.w3.org/TR/shadow-dom/#widl-Element-attachShadow-ShadowRoot-ShadowRootInit-shadowRootInitDict
3488         which now only allows attachShadow on the following elements and custom elements:
3489         button, details, input, marquee, meter, progress, select, textarea, keygen
3490
3491         In order to check that a given HTML element's local name is a valid custom element name,
3492         this patch moves CustomElementDefinitions::checkName to Document::validateCustomElementName so that
3493         it could be used when either SHADOW_DOM or CUSTOM_ELEMENTS build flag is turned on.
3494
3495         Also removed Element::canHaveUserAgentShadowRoot since it was only used in Element::attachShadow.
3496
3497         Test: fast/shadow-dom/Element-interface-attachShadow.html
3498
3499         * bindings/js/JSDocumentCustom.cpp:
3500         (WebCore::JSDocument::defineElement):
3501         * dom/CustomElementDefinitions.cpp:
3502         (WebCore::CustomElementDefinitions::checkName): Moved to Document::validateCustomElementName.
3503         * dom/CustomElementDefinitions.h:
3504         * dom/Document.cpp:
3505         (WebCore::createHTMLElementWithNameValidation):
3506         (WebCore::createFallbackHTMLElement):
3507         (WebCore::Document::validateCustomElementName): Moved from CustomElementDefinitions::checkName.
3508         * dom/Document.h:
3509         * dom/Element.cpp:
3510         (WebCore::canAttachAuthorShadowRoot): Added.
3511         (WebCore::Element::attachShadow):
3512         * dom/Element.h:
3513         * html/HTMLButtonElement.h:
3514         * html/HTMLDetailsElement.h:
3515         * html/HTMLInputElement.h:
3516         * html/HTMLKeygenElement.h:
3517         * html/HTMLMarqueeElement.h:
3518         * html/HTMLMediaElement.h:
3519         * html/HTMLMeterElement.h:
3520         * html/HTMLPlugInElement.h:
3521         * html/HTMLProgressElement.h:
3522         * html/HTMLQuoteElement.h:
3523         * html/HTMLSelectElement.h:
3524         * html/HTMLSummaryElement.h:
3525         * html/HTMLTagNames.in:
3526         * html/HTMLTextAreaElement.h:
3527         * html/HTMLUnknownElement.h:
3528         * html/parser/HTMLConstructionSite.cpp:
3529         (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
3530
3531 2016-06-03  Ryosuke Niwa  <rniwa@webkit.org>
3532
3533         Crash inside moveOutOfAllShadowRoots
3534         https://bugs.webkit.org/show_bug.cgi?id=158378
3535
3536         Reviewed by Antti Koivisto.
3537
3538         The bug was caused by InShadowTreeFlag not being cleared when a shadow host or its ancestor was removed
3539         due to addChildNodesToDeletionQueue not invoking notifyChildNodeRemoved when a node was in a shadow tree
3540         but not in a document.
3541
3542         Fixed the bug by invoking notifyChildNodeRemoved when the removed node is either in a shadow tree
3543         or it's in a shadow tree. Also fixed a bug in VTTCue::~VTTCue that it was trying to remove the display
3544         tree even when the owner document was being destroyed. This results in various assertions to be hit.
3545
3546         Test: fast/shadow-dom/shadow-host-removal-crash.html
3547
3548         * dom/ContainerNodeAlgorithms.cpp:
3549         (WebCore::addChildNodesToDeletionQueue):
3550         * html/track/VTTCue.cpp:
3551         (WebCore::VTTCue::~VTTCue):
3552
3553 2016-06-06  Chris Dumez  <cdumez@apple.com>
3554
3555         Implement EventListenerOptions argument to addEventListener
3556         https://bugs.webkit.org/show_bug.cgi?id=149466
3557         <rdar://problem/22802031>
3558
3559         Reviewed by Dean Jackson.
3560
3561         Implement AddEventListenerOptions dictionary argument to addEventListener()
3562         and EventListenerOptions dictionary argument to removeEventListener(), as
3563         per the latest DOM specification:
3564         - https://dom.spec.whatwg.org/#interface-eventtarget
3565
3566         Firefox and Chrome already support this.
3567
3568         Support for AddEventListenerOptions in this patch is as follows:
3569         - 'capture': fully supported.
3570         - 'once': fully supported.
3571         - 'passive': supported in the sense that preventDefault() will be ignored
3572                      for passive event listeners. There are however currently no
3573                      performance benefits from passing this flag. Those optimizations
3574                      will be implemented in follow-up patches (in particular for
3575                      Touch and Scroll events).
3576
3577         Tests: fast/events/AddEventListenerOptions-once-recursive.html
3578                fast/events/AddEventListenerOptions-once.html
3579                fast/events/AddEventListenerOptions-passive.html
3580                fast/events/removeEventListener-EventListenerOptions-capture.html
3581                imported/w3c/web-platform-tests/dom/events/EventListenerOptions-capture.html
3582
3583         * Modules/webaudio/AudioScheduledSourceNode.cpp:
3584         (WebCore::AudioScheduledSourceNode::addEventListener):
3585         (WebCore::AudioScheduledSourceNode::removeEventListener):
3586         * Modules/webaudio/AudioScheduledSourceNode.h:
3587         * Modules/webaudio/ScriptProcessorNode.cpp:
3588         (WebCore::ScriptProcessorNode::addEventListener):
3589         (WebCore::ScriptProcessorNode::removeEventListener):
3590         * Modules/webaudio/ScriptProcessorNode.h:
3591         * bindings/scripts/CodeGeneratorJS.pm:
3592         (GenerateParametersCheckExpression):
3593         * dom/Event.h:
3594         (WebCore::Event::preventDefault):
3595         (WebCore::Event::setInPassiveListener):
3596         * dom/EventListenerMap.cpp:
3597         (WebCore::addListenerToVector):
3598         (WebCore::EventListenerMap::add):
3599         * dom/EventListenerMap.h:
3600         * dom/EventTarget.cpp:
3601         (WebCore::EventTarget::addEventListener):
3602         (WebCore::EventTarget::addEventListenerForBindings):
3603         (WebCore::EventTarget::removeEventListenerForBindings):
3604         (WebCore::EventTarget::removeEventListener):
3605         (WebCore::EventTarget::setAttributeEventListener):
3606         (WebCore::EventTarget::fireEventListeners):
3607         * dom/EventTarget.h:
3608         (WebCore::EventTarget::ListenerOptions::ListenerOptions):
3609         (WebCore::EventTarget::AddEventListenerOptions::AddEventListenerOptions):
3610         (WebCore::EventTarget::addEventListener):
3611         (WebCore::EventTarget::addEventListenerForBindings):
3612         (WebCore::EventTarget::removeEventListenerForBindings):
3613         * dom/EventTarget.idl:
3614         * dom/MessagePort.cpp:
3615         (WebCore::MessagePort::addEventListener):
3616         * dom/MessagePort.h:
3617         * dom/Node.cpp:
3618         (WebCore::tryAddEventListener):
3619         (WebCore::Node::addEventListener):
3620         (WebCore::tryRemoveEventListener):
3621         (WebCore::Node::removeEventListener):
3622         * dom/Node.h:
3623         * dom/RegisteredEventListener.h:
3624         (WebCore::RegisteredEventListener::Options::Options):
3625         (WebCore::RegisteredEventListener::RegisteredEventListener):
3626         (WebCore::operator==):
3627         * html/HTMLMediaElement.cpp:
3628         (WebCore::HTMLMediaElement::addEventListener):
3629         (WebCore::HTMLMediaElement::removeEventListener):
3630         * html/HTMLMediaElement.h:
3631         * page/DOMWindow.cpp:
3632         (WebCore::DOMWindow::addEventListener):
3633         (WebCore::DOMWindow::removeEventListener):
3634         * page/DOMWindow.h:
3635         * svg/SVGElement.cpp:
3636         (WebCore::SVGElement::addEventListener):
3637         (WebCore::SVGElement::removeEventListener):
3638         * svg/SVGElement.h:
3639
3640 2016-06-06  Commit Queue  <commit-queue@webkit.org>
3641
3642         Unreviewed, rolling out r201730.
3643         https://bugs.webkit.org/show_bug.cgi?id=158453
3644
3645         This change caused existing LayoutTests to crash (Requested by
3646         ryanhaddad on #webkit).
3647
3648         Reverted changeset:
3649
3650         "Implement EventListenerOptions argument to addEventListener"
3651         https://bugs.webkit.org/show_bug.cgi?id=149466
3652         http://trac.webkit.org/changeset/201730
3653
3654 2016-06-06  Chris Dumez  <cdumez@apple.com>
3655
3656         Implement EventListenerOptions argument to addEventListener
3657         https://bugs.webkit.org/show_bug.cgi?id=149466
3658         <rdar://problem/22802031>
3659
3660         Reviewed by Dean Jackson.
3661
3662         Implement AddEventListenerOptions dictionary argument to addEventListener()
3663         and EventListenerOptions dictionary argument to removeEventListener(), as
3664         per the latest DOM specification:
3665         - https://dom.spec.whatwg.org/#interface-eventtarget
3666
3667         Firefox and Chrome already support this.
3668
3669         Support for AddEventListenerOptions in this patch is as follows:
3670         - 'capture': fully supported.
3671         - 'once': fully supported.
3672         - 'passive': supported in the sense that preventDefault() will be ignored
3673                      for passive event listeners. There are however currently no
3674                      performance benefits from passing this flag. Those optimizations
3675                      will be implemented in follow-up patches (in particular for
3676                      Touch and Scroll events).
3677
3678         Tests: fast/events/AddEventListenerOptions-once-recursive.html
3679                fast/events/AddEventListenerOptions-once.html
3680                fast/events/AddEventListenerOptions-passive.html
3681                fast/events/removeEventListener-EventListenerOptions-capture.html
3682                imported/w3c/web-platform-tests/dom/events/EventListenerOptions-capture.html
3683
3684         * Modules/webaudio/AudioScheduledSourceNode.cpp:
3685         (WebCore::AudioScheduledSourceNode::addEventListener):
3686         (WebCore::AudioScheduledSourceNode::removeEventListener):
3687         * Modules/webaudio/AudioScheduledSourceNode.h:
3688         * Modules/webaudio/ScriptProcessorNode.cpp:
3689         (WebCore::ScriptProcessorNode::addEventListener):
3690         (WebCore::ScriptProcessorNode::removeEventListener):
3691         * Modules/webaudio/ScriptProcessorNode.h:
3692         * bindings/scripts/CodeGeneratorJS.pm:
3693         (GenerateParametersCheckExpression):
3694         * dom/Event.h:
3695         (WebCore::Event::preventDefault):
3696         (WebCore::Event::setInPassiveListener):
3697         * dom/EventListenerMap.cpp:
3698         (WebCore::addListenerToVector):
3699         (WebCore::EventListenerMap::add):
3700         * dom/EventListenerMap.h:
3701         * dom/EventTarget.cpp:
3702         (WebCore::EventTarget::addEventListener):
3703         (WebCore::EventTarget::addEventListenerForBindings):
3704         (WebCore::EventTarget::removeEventListenerForBindings):
3705         (WebCore::EventTarget::removeEventListener):
3706         (WebCore::EventTarget::setAttributeEventListener):
3707         (WebCore::EventTarget::fireEventListeners):
3708         * dom/EventTarget.h:
3709         (WebCore::EventTarget::ListenerOptions::ListenerOptions):
3710         (WebCore::EventTarget::AddEventListenerOptions::AddEventListenerOptions):
3711         (WebCore::EventTarget::addEventListener):
3712         (WebCore::EventTarget::addEventListenerForBindings):
3713         (WebCore::EventTarget::removeEventListenerForBindings):
3714         * dom/EventTarget.idl:
3715         * dom/MessagePort.cpp:
3716         (WebCore::MessagePort::addEventListener):
3717         * dom/MessagePort.h:
3718         * dom/Node.cpp:
3719         (WebCore::tryAddEventListener):
3720         (WebCore::Node::addEventListener):
3721         (WebCore::tryRemoveEventListener):
3722         (WebCore::Node::removeEventListener):
3723         * dom/Node.h:
3724         * dom/RegisteredEventListener.h:
3725         (WebCore::RegisteredEventListener::Options::Options):
3726         (WebCore::RegisteredEventListener::RegisteredEventListener):
3727         (WebCore::operator==):
3728         * html/HTMLMediaElement.cpp:
3729         (WebCore::HTMLMediaElement::addEventListener):
3730         (WebCore::HTMLMediaElement::removeEventListener):
3731         * html/HTMLMediaElement.h:
3732         * page/DOMWindow.cpp:
3733         (WebCore::DOMWindow::addEventListener):
3734         (WebCore::DOMWindow::removeEventListener):
3735         * page/DOMWindow.h:
3736         * svg/SVGElement.cpp:
3737         (WebCore::SVGElement::addEventListener):
3738         (WebCore::SVGElement::removeEventListener):
3739         * svg/SVGElement.h:
3740
3741 2016-06-06  Jer Noble  <jer.noble@apple.com>
3742
3743         Media elements should only be allowed to control controls manager during a user gesture.
3744         https://bugs.webkit.org/show_bug.cgi?id=158432
3745
3746         Reviewed by Eric Carlson.
3747
3748         Add a new MediaElementSession behavior restriction for the controls manager
3749         which is cleared on the first user gesture. Since canControlControlsManager()
3750         may be called before the first layout, call updatePlaybackControlsManager()
3751         since the main content check requires the laid-out size of the media element.
3752
3753         (WebCore::HTMLMediaElement::HTMLMediaElement):
3754         (WebCore::HTMLMediaElement::layoutSizeChanged):
3755         (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture):
3756         * html/HTMLMediaElement.h:
3757         * html/MediaElementSession.cpp:
3758         (WebCore::MediaElementSession::canControlControlsManager):
3759         * html/MediaElementSession.h:
3760
3761 2016-06-06  Adam Bergkvist  <adam.bergkvist@ericsson.com>
3762
3763         WebRTC: Update MediaEndpointPeerConnection::createOffer() to use the transceiver set
3764         https://bugs.webkit.org/show_bug.cgi?id=158203
3765
3766         Reviewed by Eric Carlson.
3767
3768         Create an SDP offer based on the RTCPeerConnection object's set of RTCRtpTransceiver objects
3769         (instead of RTCRtpSender objects).
3770
3771         Updated existing test: fast/mediastream/RTCPeerConnection-inspect-offer.html
3772
3773         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
3774         (WebCore::matchTransceiver):
3775         (WebCore::matchTransceiverByMid):
3776         (WebCore::MediaEndpointPeerConnection::createOfferTask):
3777         * Modules/mediastream/MediaEndpointPeerConnection.h:
3778         * Modules/mediastream/PeerConnectionBackend.h:
3779         Remove getSenders() which is replaced by getTransceivers().
3780         * Modules/mediastream/RTCPeerConnection.h:
3781         * Modules/mediastream/SDPProcessor.cpp:
3782         (WebCore::configurationFromJSON):
3783         (WebCore::configurationToJSON):
3784         * Modules/mediastream/sdp.js:
3785         (SDP.parse):
3786         (SDP.generate):
3787         Add support for mid attribute.
3788         * platform/mediastream/PeerMediaDescription.h:
3789         (WebCore::PeerMediaDescription::mid):
3790         (WebCore::PeerMediaDescription::setMid):
3791         (WebCore::PeerMediaDescription::clone):
3792
3793 2016-06-06  George Ruan  <gruan@apple.com>
3794
3795         Support createPattern(HTMLVideoElement, const String& repetitionType)
3796         https://bugs.webkit.org/show_bug.cgi?id=149984
3797         <rdar://problem/23058823>
3798
3799         Reviewed by Dean Jackson.
3800
3801         Support functionality for HTMLVideoElement argument for
3802         CanvasRenderingContext2D::createPattern*()
3803
3804         Tests: fast/canvas/canvas-createPattern-video-invalid.html
3805                fast/canvas/canvas-createPattern-video-loading.html
3806                fast/canvas/canvas-createPattern-video-modify.html
3807                http/tests/security/canvas-remote-read-remote-video-allowed-anonymous.html
3808                http/tests/security/canvas-remote-read-remote-video-allowed-with-credentials.html
3809                http/tests/security/canvas-remote-read-remote-video-blocked-no-crossorigin.html
3810                http/tests/security/canvas-remote-read-remote-video-localhost.html
3811                http/tests/security/canvas-remote-read-remote-video-redirect.html
3812                media/video-canvas-createPattern.html
3813
3814         * html/canvas/CanvasRenderingContext2D.cpp:
3815         (WebCore::CanvasRenderingContext2D::createPattern): Implement
3816         functionality of description
3817         * html/canvas/CanvasRenderingContext2D.h:
3818         * html/canvas/CanvasRenderingContext2D.idl:
3819
3820 2016-06-06  Csaba Osztrogon√°c  <ossy@webkit.org>
3821
3822         Fix the !ENABLE(SHADOW_DOM) && !ENABLE(DETAILS_ELEMENT) build
3823         https://bugs.webkit.org/show_bug.cgi?id=158347
3824
3825         Reviewed by Chris Dumez.
3826
3827         * dom/ContainerNode.cpp:
3828         (WebCore::destroyRenderTreeIfNeeded):
3829
3830 2016-06-06  Alex Christensen  <achristensen@webkit.org>
3831
3832         Remove unused ResourceResponse::platformResponseIsUpToDate
3833         https://bugs.webkit.org/show_bug.cgi?id=158424
3834
3835         Reviewed by Brady Eidson.
3836
3837         No change in behavior, just removing unused code that was introduced in r145007.
3838
3839         * platform/network/cf/ResourceResponse.h:
3840         (WebCore::ResourceResponse::ResourceResponse):
3841         (WebCore::ResourceResponse::platformResponseIsUpToDate): Deleted.
3842         * platform/network/cocoa/ResourceResponseCocoa.mm:
3843         (WebCore::ResourceResponse::ResourceResponse):
3844         * platform/network/curl/ResourceResponse.h:
3845         (WebCore::ResourceResponse::cfURLResponse):
3846         (WebCore::ResourceResponse::platformResponseIsUpToDate): Deleted.
3847         * platform/network/soup/ResourceResponse.h:
3848         (WebCore::ResourceResponse::soupMessageTLSErrors):
3849         (WebCore::ResourceResponse::setSoupMessageTLSErrors):
3850         (WebCore::ResourceResponse::decode):
3851         (WebCore::ResourceResponse::platformResponseIsUpToDate): Deleted.
3852
3853 2016-06-05  Gavin & Ellie Barraclough  <barraclough@apple.com>
3854
3855         Deprecate remaining uses of Lookup getStatic*, use HasStaticPropertyTable instead.
3856         https://bugs.webkit.org/show_bug.cgi?id=158178
3857
3858         Reviewed by Darin Adler.
3859
3860         As of bug #158059 most JSC static table property access no longer requires getOwnPropertySlot to be
3861         overridden. Port remaining calls to the getStatic* functions in Lookup.h over to the new mechanism.
3862
3863         Switch WebCore DOM instance bindings to use HasStaticPropertyTable.
3864
3865         * bindings/js/JSPluginElementFunctions.h:
3866         (WebCore::pluginElementCustomGetOwnPropertySlot):
3867             - Switch call from getStaticValueSlot to Type::getOwnPropertySlot.
3868               For any element where Type::hasStaticPropertyTable is true the HasStaticPropertyTable
3869               structure flag will also be set, so Type::getOwnPropertySlot will do the same thing.
3870         * bindings/scripts/CodeGeneratorJS.pm:
3871         (GenerateGetOwnPropertySlotBody):
3872             - If we override getOwnPropertySlot, Base::getOwnPropertySlot will handle property storage & static property lookup.
3873         (InstanceOverridesGetOwnPropertySlot):
3874             - Instances only override getOwnPropertySlot if the really need to, not just for static property lookup.
3875         (GenerateHeader):
3876             - Set HasStaticPropertyTable in instance structureFlags, where appropriate.
3877         (GenerateImplementation):
3878             - GenerateGetOwnPropertySlotBody no longer needs to know if there are static properties.
3879         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3880         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
3881         * bindings/scripts/test/JS/JSTestException.cpp:
3882         * bindings/scripts/test/JS/JSTestException.h:
3883         * bindings/scripts/test/JS/JSTestObj.cpp:
3884         * bindings/scripts/test/JS/JSTestObj.h:
3885         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3886         * bindings/scripts/test/JS/JSTestTypedefs.h:
3887         * bindings/scripts/test/JS/JSattribute.cpp:
3888         * bindings/scripts/test/JS/JSattribute.h:
3889             - Updating bindings test results.
3890
3891 2016-06-06  Brady Eidson  <beidson@apple.com>
3892
3893         Modern IDB: Crash seen in IDBConnectionProxy::putOrAdd on GuardMalloc bot
3894         https://bugs.webkit.org/show_bug.cgi?id=158124
3895
3896         Reviewed by Darin Adler.
3897
3898         No new tests (Covered by existing test configurations).
3899
3900         * Modules/indexeddb/IDBTransaction.cpp:
3901         (WebCore::IDBTransaction::putOrAddOnServer):
3902         
3903         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
3904         (WebCore::IDBClient::IDBConnectionProxy::putOrAdd):
3905         
3906         * Modules/indexeddb/client/IDBConnectionProxy.h:
3907         (WebCore::IDBClient::IDBConnectionProxy::callConnectionOnMainThread):
3908         
3909         * bindings/js/SerializedScriptValue.cpp:
3910         (WebCore::SerializedScriptValue::writeBlobsToDiskForIndexedDB):
3911         * bindings/js/SerializedScriptValue.h:
3912         
3913         * platform/network/BlobRegistry.h:
3914         * platform/network/BlobRegistryImpl.cpp:
3915         (WebCore::BlobRegistryImpl::writeBlobsToTemporaryFiles):
3916         * platform/network/BlobRegistryImpl.h:
3917
3918 2016-06-06  Commit Queue  <commit-queue@webkit.org>
3919
3920         Unreviewed, rolling out r201706.
3921         https://bugs.webkit.org/show_bug.cgi?id=158427
3922
3923         This change broke the Yosemite build and its LayoutTest is
3924         failing on Mac and iOS testers (Requested by ryanhaddad on
3925         #webkit).
3926
3927         Reverted changeset:
3928
3929         "Add experimental support for spring based CSS animations"
3930         https://bugs.webkit.org/show_bug.cgi?id=158403
3931         http://trac.webkit.org/changeset/201706
3932
3933 2016-06-06  Javier Fernandez  <jfernandez@igalia.com>
3934
3935         [css-grid] Horizontal scroll must account for grid container's height
3936         https://bugs.webkit.org/show_bug.cgi?id=157971
3937
3938         Reviewed by Darin Adler.
3939
3940         We don't consider the scrollbar when computing the grid container's
3941         logical height at the beginning of the 'layoutBlock' logic. We must
3942         do it because otherwise, contentLogicalHeight may return a negative
3943         value.
3944
3945         Test: fast/css-grid-layout/grid-container-scroll-accounts-for-sizing.html
3946
3947         * rendering/RenderGrid.cpp:
3948         (WebCore::RenderGrid::layoutBlock):
3949
3950 2016-06-06  Alex Christensen  <achristensen@webkit.org>
3951
3952         Reduce ResourceRequest copying in loading code
3953         https://bugs.webkit.org/show_bug.cgi?id=158251
3954
3955         Reviewed by Darin Adler.
3956
3957         No new tests. There should be no change in behavior except fewer unnecessary copies.
3958         Before, we would pass a const ResourceRequest& around, and if we needed to modify it
3959         we would copy the whole thing, modify the copy, and pass the copy along.  This can be
3960         accomplished with move semantics without the now-unnecessary copy.
3961         
3962         The biggest conceptual change is that the synchronous ResourceHandleClient::willSendRequest
3963         used to take a non-const ResourceRequest& and modify it, but now it returns a modified
3964         ResourceRequest instead.
3965
3966         * loader/ResourceLoader.cpp:
3967         (WebCore::ResourceLoader::cannotShowURLError):
3968         (WebCore::ResourceLoader::willSendRequest):
3969         (WebCore::ResourceLoader::didSendData):
3970         * loader/ResourceLoader.h:
3971         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
3972         (ResourceHandleStreamingClient::getOrCreateReadBuffer):
3973         (ResourceHandleStreamingClient::willSendRequest):
3974         (ResourceHandleStreamingClient::didReceiveResponse):
3975         * platform/network/ResourceHandle.h:
3976         * platform/network/ResourceHandleClient.cpp:
3977         (WebCore::ResourceHandleClient::~ResourceHandleClient):
3978         (WebCore::ResourceHandleClient::willSendRequest):
3979         (WebCore::ResourceHandleClient::willSendRequestAsync):
3980         (WebCore::ResourceHandleClient::didReceiveResponseAsync):
3981         * platform/network/ResourceHandleClient.h:
3982         (WebCore::ResourceHandleClient::didSendData):
3983         (WebCore::ResourceHandleClient::didReceiveResponse):
3984         (WebCore::ResourceHandleClient::loadingSynchronousXHR):
3985         (WebCore::ResourceHandleClient::willSendRequest): Deleted.
3986         * platform/network/SynchronousLoaderClient.cpp:
3987         (WebCore::SynchronousLoaderClient::~SynchronousLoaderClient):
3988         (WebCore::SynchronousLoaderClient::willSendRequest):
3989         (WebCore::SynchronousLoaderClient::shouldUseCredentialStorage):
3990         * platform/network/SynchronousLoaderClient.h:
3991         *