Images in feed on ebay.com jiggle when one is hovered
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-03-17  Zalan Bujtas  <zalan@apple.com>
2
3         Images in feed on ebay.com jiggle when one is hovered
4         https://bugs.webkit.org/show_bug.cgi?id=155608
5         <rdar://problem/25160681>
6
7         The content offset in compositing layer = subpixel gap between the graphics layer and the layer bounds + layer bounds top left.
8
9         Reviewed by Simon Fraser.
10
11         Test: compositing/hidpi-viewport-clipping-on-composited-content.html
12
13         * rendering/RenderLayerBacking.cpp:
14         (WebCore::RenderLayerBacking::updateGeometry):
15         (WebCore::RenderLayerBacking::contentOffsetInCompostingLayer):
16         * rendering/RenderLayerBacking.h:
17
18 2016-03-17  Zalan Bujtas  <zalan@apple.com>
19
20         Don't initiate a style recall while drawing text 
21         https://bugs.webkit.org/show_bug.cgi?id=155618
22
23         Reviewed by Simon Fraser.
24
25         This patch ensures that we don't initiate a style recalc while in the middle of text drawing.
26
27         Test: fast/canvas/crash-while-resizing-canvas.html
28
29         * html/canvas/CanvasRenderingContext2D.cpp:
30         (WebCore::CanvasRenderingContext2D::drawTextInternal):
31
32 2016-03-17  Commit Queue  <commit-queue@webkit.org>
33
34         Unreviewed, rolling out r198335.
35         https://bugs.webkit.org/show_bug.cgi?id=155617
36
37         This change caused existing LayoutTests to crash
38         intermittently (Requested by ryan|afk on #webkit).
39
40         Reverted changeset:
41
42         "DataURLDecoder::DecodingResultDispatcher may get deleted
43         outside main thread"
44         https://bugs.webkit.org/show_bug.cgi?id=155584
45         http://trac.webkit.org/changeset/198335
46
47 2016-03-17  Eric Carlson  <eric.carlson@apple.com>
48
49         Improve some metadata tests
50         https://bugs.webkit.org/show_bug.cgi?id=155616
51
52         Reviewed by Saam Barati.
53
54         * html/track/DataCue.cpp:
55         (WebCore::DataCue::DataCue):
56         (WebCore::DataCue::setData):
57
58 2016-03-17  Myles C. Maxfield  <mmaxfield@apple.com>
59
60         [RTL Scrollbars] Position: absolute divs are covered by vertical scrollbar
61         https://bugs.webkit.org/show_bug.cgi?id=155531
62
63         Reviewed by Darin Adler.
64
65         This patch updates ScrollView::documentScrollPositionRelativeToViewOrigin(), which is
66         a helper function primarily used by WebCore::ScrollView::viewToContents() and
67         WebCore::ScrollView::contentsToView().
68
69         Tests: fast/scrolling/rtl-scrollbars-elementFromPoint-static.html
70                fast/scrolling/rtl-scrollbars-elementFromPoint.html
71                fast/scrolling/rtl-scrollbars-iframe-offset.html
72                fast/scrolling/rtl-scrollbars-iframe-position-absolute.html
73                fast/scrolling/rtl-scrollbars-iframe-scrolled.html
74                fast/scrolling/rtl-scrollbars-iframe.html
75                fast/scrolling/rtl-scrollbars-overflow-elementFromPoint.html
76                fast/scrolling/rtl-scrollbars-overflow-position-absolute.html
77                fast/scrolling/rtl-scrollbars-overflow-text-selection-scrolled.html
78                fast/scrolling/rtl-scrollbars-position-absolute.html
79                fast/scrolling/rtl-scrollbars-position-fixed.html
80                fast/scrolling/rtl-scrollbars-text-selection-scrolled.html
81                fast/scrolling/rtl-scrollbars-text-selection.html
82
83         * platform/ScrollView.cpp:
84         (WebCore::ScrollView::documentScrollPositionRelativeToViewOrigin):
85
86 2016-03-17  Filip Pizlo  <fpizlo@apple.com>
87
88         Replace all of the various non-working and non-compiling sampling profiler hacks with a single super hack
89         https://bugs.webkit.org/show_bug.cgi?id=155561
90
91         Reviewed by Saam Barati.
92
93         No new tests because no new behavior.
94
95         * platform/audio/ios/MediaSessionManagerIOS.mm:
96         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
97
98 2016-03-17  Brent Fulgham  <bfulgham@apple.com>
99
100         Some media tests are flaky.
101         https://bugs.webkit.org/show_bug.cgi?id=155614
102
103         Reviewed by Eric Carlson.
104
105         * html/track/TextTrack.cpp:
106         (WebCore::TextTrack::~TextTrack):
107
108 2016-03-17  Brady Eidson  <beidson@apple.com>
109
110         Don't try to restore deleted MemoryIndexes if their owning object store is not restored.
111         https://bugs.webkit.org/show_bug.cgi?id=155068
112
113         Reviewed by Alex Christensen.
114
115         Test: storage/indexeddb/modern/deleteindex-4-private.html
116
117         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
118         (WebCore::IDBServer::MemoryBackingStoreTransaction::indexDeleted):
119
120 2016-03-17  Doug Russell  <d_russell@apple.com>
121
122         AX: attributes to retrieve focusable and editable ancestors
123         https://bugs.webkit.org/show_bug.cgi?id=155554
124
125         Reviewed by Chris Fleizach.
126
127         Add attributes to help give context to focus changes:
128         AXFocusableAncestor - nearest accessibility ancestor that returns true for
129         canSetFocusAttribute().
130         AXEditableAncestor - nearest accessibility ancestor that returns true for
131         isTextControl().
132         AXHighestEditableAncestor - highest element in accessibility that returns true
133         for isTextControl().
134
135         Test: accessibility/mac/ancestor-attributes.html
136
137         * accessibility/AccessibilityNodeObject.cpp:
138         * accessibility/AccessibilityObject.cpp:
139         (WebCore::AccessibilityObject::focusableAncestor):
140         (WebCore::AccessibilityObject::editableAncestor):
141         (WebCore::AccessibilityObject::highestEditableAncestor):
142         * accessibility/AccessibilityObject.h:
143         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
144         (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
145         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
146
147 2016-03-17  Sam Weinig  <sam@webkit.org>
148
149         Implement document.queryCommandSupported("copy")
150         https://bugs.webkit.org/show_bug.cgi?id=155548
151         <rdar://problem/25195295>
152
153         Reviewed by Enrica Casucci.
154
155         - document.queryCommandSupported("copy") and document.queryCommandSupported("cut") need
156           to return true if the ClipboardAccessPolicy is either Allow or RequiresUserGesture.
157           But, document.queryCommandEnabled("copy") and document.queryCommandEnabled("cut")
158           should still return false when there is no user gesture. I also had to maintain a weird
159           quirk that copy and cut should be allowed to execute, and thus fire the oncopy and oncut
160           events, even when disabled, if coming from a "MenuOrKeyBinding" source. To do this, I
161           upgraded the allowExecutionWhenDisabled bit to a function taking a source, and return true
162           only when the correct source is specified.
163
164         * editing/Editor.h:
165         * editing/EditorCommand.cpp:
166         (WebCore::defaultValueForSupportedCopyCut):
167         (WebCore::allowCopyCutFromDOM):
168         (WebCore::enabledCopy):
169         (WebCore::enabledCut):
170         (WebCore::allowExecutionWhenDisabled):
171         (WebCore::doNotAllowExecutionWhenDisabled):
172         (WebCore::allowExecutionWhenDisabledCopyCut):
173         (WebCore::Editor::Command::execute):
174         (WebCore::Editor::Command::allowExecutionWhenDisabled):
175
176 2016-03-17  Antti Koivisto  <antti@apple.com>
177
178         DataURLDecoder::DecodingResultDispatcher may get deleted outside main thread
179         https://bugs.webkit.org/show_bug.cgi?id=155584
180         rdar://problem/24492104
181
182         Reviewed by Chris Dumez.
183
184         This is unsafe as it owns strings and other types that are only safe to delete in the main thread.
185
186         * platform/network/DataURLDecoder.cpp:
187         (WebCore::DataURLDecoder::DecodingResultDispatcher::dispatch):
188
189             The problem is that this was a refcounted type. This created a race. If the timer fired before dispatch()
190             was exited the implicit deref here would trigger the deletion in the dispatching thread.
191
192             Fix by getting rid of the unnecessary refcounting. Timer firing will now delete the instance explicitly.
193
194         (WebCore::DataURLDecoder::DecodingResultDispatcher::startTimer):
195         (WebCore::DataURLDecoder::DecodingResultDispatcher::timerFired):
196
197 2016-03-17  Commit Queue  <commit-queue@webkit.org>
198
199         Unreviewed, rolling out r198201.
200         https://bugs.webkit.org/show_bug.cgi?id=155585
201
202         That was not the proper solution (Requested by KaL on
203         #webkit).
204
205         Reverted changeset:
206
207         "REGRESSION (r197724): [GTK] Web Inspector: Images being
208         blocked by CSP 2.0"
209         https://bugs.webkit.org/show_bug.cgi?id=155432
210         http://trac.webkit.org/changeset/198201
211
212 2016-03-16  Chris Fleizach  <cfleizach@apple.com>
213
214         AX: Implement AutoFill Available attribute for a text field
215         https://bugs.webkit.org/show_bug.cgi?id=155567
216
217         Reviewed by Darin Adler.
218
219         Expose the auto fill buttons to the AX hierarchy.
220         Add an attribute for the textfield to inform when the auto fill button is available.
221
222         Test: accessibility/auto-fill-types.html
223
224         * English.lproj/Localizable.strings:
225         * accessibility/AccessibilityObject.cpp:
226         (WebCore::AccessibilityObject::element):
227         (WebCore::AccessibilityObject::isValueAutofillAvailable):
228         (WebCore::AccessibilityObject::isValueAutofilled):
229         * accessibility/AccessibilityObject.h:
230         (WebCore::AccessibilityObject::passwordFieldValue):
231         * accessibility/AccessibilityRenderObject.cpp:
232         (WebCore::AccessibilityRenderObject::addTextFieldChildren):
233         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
234         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
235         * html/TextFieldInputType.cpp:
236         (WebCore::limitLength):
237         (WebCore::autoFillButtonTypeToAccessibilityLabel):
238         (WebCore::autoFillButtonTypeToAutoFillButtonPseudoClassName):
239         (WebCore::TextFieldInputType::createAutoFillButton):
240         (WebCore::TextFieldInputType::updateAutoFillButton):
241         * platform/LocalizedStrings.cpp:
242         (WebCore::AXListItemActionVerb):
243         (WebCore::AXAutoFillCredentialsLabel):
244         (WebCore::AXAutoFillContactsLabel):
245         (WebCore::AXARIAContentGroupText):
246         * platform/LocalizedStrings.h:
247
248 2016-03-17  Csaba Osztrogonác  <ossy@webkit.org>
249
250         [Mac][cmake] Unreviewed speculative buildfix after r198179. Just for fun.
251
252         * PlatformMac.cmake:
253
254 2016-03-17  Youenn Fablet  <youenn.fablet@crf.canon.fr>
255
256         [Fetch API] response-consume.html is crashing on Mac WK1 Debug builds
257         https://bugs.webkit.org/show_bug.cgi?id=155490
258
259         Reviewed by Darin Adler.
260
261         Covered by existing tests.
262
263         Ensured to lock state before calling JSC:JSONParse.
264         Adding fulfillPromiseWithJSON routine to handle it.
265         Applied it to FetchBody.
266
267         * Modules/fetch/FetchBody.cpp:
268         (WebCore::FetchBody::json):
269         (WebCore::FetchBody::loadedAsText):
270         (WebCore::FetchBody::resolveAsJSON): Deleted.
271         * Modules/fetch/FetchBody.h:
272         * Modules/fetch/FetchBodyOwner.cpp:
273         (WebCore::FetchBodyOwner::loadedBlobAsText):
274         * bindings/js/JSDOMPromise.cpp:
275         (WebCore::parseAsJSON):
276         (WebCore::fulfillPromiseWithJSON):
277         * bindings/js/JSDOMPromise.h:
278
279 2016-03-17  Adam Bergkvist  <adam.bergkvist@ericsson.com>
280
281         WebRTC: Update RTCIceCandidate
282         https://bugs.webkit.org/show_bug.cgi?id=155535
283
284         Reviewed by Eric Carlson.
285
286         Update the RTCIceCandidate constructor procedure to match the WebRTC 1.0 specification [1].
287         In short: The "candidate" init dictionary member is required. At least one of the dictionary
288         members "sdpMid" and "sdpMLine" needs to be present; the corresponding attribute of the
289         other, is initialized to null.
290
291         [1] https://w3c.github.io/webrtc-pc/archives/20160215/webrtc.html
292
293         Tests: Updated fast/mediastream/RTCIceCandidate.htm
294
295         * Modules/mediastream/RTCIceCandidate.cpp:
296         (WebCore::RTCIceCandidate::create):
297         (WebCore::RTCIceCandidate::RTCIceCandidate):
298         * Modules/mediastream/RTCIceCandidate.h:
299         (WebCore::RTCIceCandidate::sdpMLineIndex):
300         (WebCore::RTCIceCandidate::setSdpMLineIndex):
301         * Modules/mediastream/RTCIceCandidate.idl:
302         * bindings/js/JSRTCIceCandidateCustom.cpp:
303         (WebCore::JSRTCIceCandidate::sdpMid):
304         (WebCore::JSRTCIceCandidate::sdpMLineIndex):
305
306 2016-03-16  Nikos Andronikos  <nikos.andronikos-webkit@cisra.canon.com.au>
307
308         SVG tear offs should return a const reference if possible
309         https://bugs.webkit.org/show_bug.cgi?id=153214
310
311         Reviewed by Alex Christensen.
312
313         A smaller change than expected because the returned reference is being copied into a value in additional locations that baseVal and animVal are used.
314
315         No new tests as there is no change in behaviour.
316
317         * svg/properties/SVGAnimatedEnumerationPropertyTearOff.h:
318         * svg/properties/SVGAnimatedStaticPropertyTearOff.h:
319         (WebCore::SVGAnimatedStaticPropertyTearOff::baseVal):
320         (WebCore::SVGAnimatedStaticPropertyTearOff::animVal):
321
322 2016-03-16  Chris Dumez  <cdumez@apple.com>
323
324         Unreviewed, partial roll out of r197254.
325         <rdar://problem/25078552>
326
327         It caused a ~1.1% PLT regression on iOS.
328
329         * loader/FrameLoader.cpp:
330         (WebCore::FrameLoader::commitProvisionalLoad): Deleted.
331
332 2016-03-16  Enrica Casucci  <enrica@apple.com>
333
334         Recognize mailto and tel url as data detector links.
335         https://bugs.webkit.org/show_bug.cgi?id=155569
336         rdar://problem/24836185
337
338         Reviewed by Sam Weinig.
339
340         When we check if the element is a data detector link,
341         we should return true also for URLs with mailto: and tel: scheme.
342
343         * editing/cocoa/DataDetection.mm:
344         (WebCore::DataDetection::isDataDetectorLink):
345
346 2016-03-16  Zalan Bujtas  <zalan@apple.com>
347
348         Subpixel rendering: Directly composited image layers need pixelsnapping.
349         https://bugs.webkit.org/show_bug.cgi?id=155558
350
351         Reviewed by Simon Fraser.
352
353         In order to match non-composited image size/position, we need to pixelsnap both the contents and the clipping
354         layer bounds for directly composited images.
355
356         Test: fast/images/hidpi-directly-composited-image-on-subpixel-position.html
357
358         * rendering/RenderLayerBacking.cpp:
359         (WebCore::RenderLayerBacking::resetContentsRect):
360         (WebCore::RenderLayerBacking::updateChildClippingStrategy):
361         (WebCore::RenderLayerBacking::updateImageContents):
362
363 2016-03-16  Beth Dakin  <bdakin@apple.com>
364
365         Provide NSSpellChecker spellChecking methods with the current insertion point
366         https://bugs.webkit.org/show_bug.cgi?id=155532
367         -and corresponding-
368         rdar://problem/24066952
369
370         Reviewed by Simon Fraser.
371
372         Pass the Frame’s selection to a handful of spelling checking methods that 
373         call into WebKit/WebKit2 to ultimately call into NSSpellChecker.
374         * accessibility/AccessibilityObject.cpp:
375         (WebCore::AccessibilityObject::hasMisspelling):
376         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
377         (AXAttributeStringSetSpelling):
378         * editing/AlternativeTextController.cpp:
379         (WebCore::AlternativeTextController::timerFired):
380         * editing/Editor.cpp:
381         (WebCore::Editor::guessesForMisspelledWord):
382         (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
383         * editing/SpellChecker.cpp:
384         (WebCore::SpellChecker::invokeRequest):
385         (WebCore::SpellChecker::enqueueRequest):
386         * editing/TextCheckingHelper.cpp:
387         (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
388         (WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange):
389         (WebCore::TextCheckingHelper::unifiedTextCheckerEnabled):
390         (WebCore::checkTextOfParagraph):
391         * editing/TextCheckingHelper.h:
392         * loader/EmptyClients.cpp:
393         (WebCore::EmptyFrameLoaderClient::createNetworkingContext):
394         (WebCore::EmptyTextCheckerClient::requestCheckingOfString):
395         * loader/EmptyClients.h:
396         * platform/text/TextCheckerClient.h:
397         (WebCore::TextCheckerClient::~TextCheckerClient):
398
399         The key needed to include the insertion point.
400         * platform/spi/mac/NSSpellCheckerSPI.h:
401
402 2016-03-16  Alex Christensen  <achristensen@webkit.org>
403
404         Fix assertion failure on drive.google.com after r196052
405         https://bugs.webkit.org/show_bug.cgi?id=155562
406
407         Reviewed by Jer Noble.
408
409         * rendering/RenderGeometryMap.cpp:
410         (WebCore::RenderGeometryMap::mapToContainer):
411         Change float equality check to areEssentiallyEqual.
412         This assertion was failing because rendererMappedResult was (944.335693, 232.047409)
413         but result was (944.335693, 232.047394).  They differ by (0, 0.000015).
414
415 2016-03-16  Nan Wang  <n_wang@apple.com>
416
417         AX: Expose aria-current status to children
418         https://bugs.webkit.org/show_bug.cgi?id=155469
419
420         Reviewed by Chris Fleizach.
421
422         Added aria-current to the global ARIA attributes list.
423
424         Test: accessibility/aria-current-global-attribute.html
425
426         * accessibility/AccessibilityObject.cpp:
427         (WebCore::AccessibilityObject::supportsARIAAttributes):
428
429 2016-03-16  Tim Horton  <timothy_horton@apple.com>
430
431         [mac] Printing test snapshots are upside-down after r198242
432         https://bugs.webkit.org/show_bug.cgi?id=155543
433
434         Reviewed by Simon Fraser.
435
436         * page/PrintContext.cpp:
437         (WebCore::PrintContext::spoolAllPagesWithBoundaries):
438         Stop PLATFORM(COCOA)-conditionally flipping here. Just paint.
439         This function is only used by the test runners so this doesn't have a
440         huge impact on anything else.
441
442 2016-03-16  Daniel Bates  <dabates@apple.com>
443
444         Update WebKit Feature Status page to include the status of Content Security Policy Level 2 and Level 3
445
446         * features.json:
447
448 2016-03-16  Daniel Bates  <dabates@apple.com>
449
450         <video> and <audio> elements do not obey Content Security Policy on redirect
451         https://bugs.webkit.org/show_bug.cgi?id=155509
452         <rdar://problem/10234844>
453
454         Reviewed by Alex Christensen.
455
456         Fixes an issue where the Content Security Policy of the page was not enforced
457         on redirects when loading a media subresource via an HTML video or HTML audio
458         element.
459
460         Tests: http/tests/security/contentSecurityPolicy/audio-redirect-allowed.html
461                http/tests/security/contentSecurityPolicy/audio-redirect-blocked.html
462                http/tests/security/contentSecurityPolicy/font-redirect-allowed.html
463                http/tests/security/contentSecurityPolicy/font-redirect-blocked.html
464                http/tests/security/contentSecurityPolicy/image-redirect-allowed.html
465                http/tests/security/contentSecurityPolicy/image-redirect-blocked.html
466                http/tests/security/contentSecurityPolicy/script-redirect-allowed.html
467                http/tests/security/contentSecurityPolicy/script-redirect-blocked.html
468                http/tests/security/contentSecurityPolicy/stylesheet-redirect-allowed.html
469                http/tests/security/contentSecurityPolicy/stylesheet-redirect-blocked.html
470                http/tests/security/contentSecurityPolicy/svg-font-redirect-allowed.html
471                http/tests/security/contentSecurityPolicy/svg-font-redirect-blocked.html
472                http/tests/security/contentSecurityPolicy/svg-image-redirect-allowed.html
473                http/tests/security/contentSecurityPolicy/svg-image-redirect-blocked.html
474                http/tests/security/contentSecurityPolicy/track-redirect-allowed.html
475                http/tests/security/contentSecurityPolicy/track-redirect-blocked.html
476                http/tests/security/contentSecurityPolicy/video-redirect-allowed.html
477                http/tests/security/contentSecurityPolicy/video-redirect-blocked.html
478                http/tests/security/contentSecurityPolicy/xsl-redirect-allowed.html
479                http/tests/security/contentSecurityPolicy/xsl-redirect-blocked.html
480
481         * inspector/InspectorPageAgent.cpp:
482         (WebCore::InspectorPageAgent::cachedResourceContent): Treat media resources as raw resources just as we do currently.
483         (WebCore::InspectorPageAgent::cachedResourceType): Ditto.
484         * loader/MediaResourceLoader.cpp:
485         (WebCore::MediaResourceLoader::requestResource): Modified to use CachedResourceLoader::requestMedia() instead
486         of CachedResourceLoader::requestRawResource() so that we can differentiate between a media resource and a raw
487         resource in CachedResourceLoader. Added FIXME comment to skip checking the Content Security Policy for loads
488         initiated by an element in a user agent shadow tree. See <https://bugs.webkit.org/show_bug.cgi?id=155505> for
489         more details.
490         * loader/ResourceLoadInfo.cpp:
491         (WebCore::toResourceType): Treat media resources as raw resources just as we do currently. Also, add cases for
492         CachedResource::LinkPrefetch and CachedResource::LinkSubresource (when ENABLE(LINK_PREFETCH) is enabled) and
493         remove the default statement to force a compile-time error when a new CachedResource enumerator is added and
494         the switch block in this function is not updated.
495         * loader/SubresourceLoader.cpp:
496         (WebCore::logResourceLoaded): Ditto.
497         * loader/cache/CachedRawResource.cpp:
498         (WebCore::CachedRawResource::CachedRawResource): Substitute CachedResource::isMainOrMediaOrRawResource() for
499         CachedResource::isMainOrRawResource() as the latter was renamed to the former.
500         * loader/cache/CachedRawResource.h:
501         (isType): Ditto.
502         * loader/cache/CachedResource.cpp:
503         (WebCore::defaultPriorityForResourceType): Use priority ResourceLoadPriority::Medium for media resources just as
504         we do currently.
505         * loader/cache/CachedResource.h:
506         (WebCore::CachedResource::isMainOrMediaOrRawResource): Formerly named isMainOrRawResource. Returns true if the type
507         of this resource is a main resource, media resource, or raw resource.
508         (WebCore::CachedResource::isMainOrRawResource): Deleted.
509         * loader/cache/CachedResourceLoader.cpp:
510         (WebCore::createResource): Treat media resources as raw resources just as we do currently.
511         (WebCore::CachedResourceLoader::requestMedia): Added.
512         (WebCore::contentTypeFromResourceType): Consider media resources as MixedContentChecker::ContentType::Active
513         just as we do currently.
514         (WebCore::CachedResourceLoader::checkInsecureContent): Apply the mixed content policy to media resources
515         just as we do currently.
516         (WebCore::CachedResourceLoader::canRequest): Apply the Same Origin Policy to media resources just as we
517         do currently. Query the Content Security Policy of the page to determine if the media resource can be
518         requested.
519         (WebCore::CachedResourceLoader::determineRevalidationPolicy): Substitute CachedResource::isMainOrMediaOrRawResource()
520         for CachedResource::isMainOrRawResource() as the latter was renamed to the former.
521         * loader/cache/CachedResourceLoader.h:
522         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
523         (WebCore::WebCoreAVFResourceLoader::startLoading): Modified to use CachedResourceLoader::requestMedia() instead
524         of CachedResourceLoader::requestRawResource() so that we can differentiate between a media resource and a raw
525         resource in CachedResourceLoader. Added FIXME comment to skip checking the Content Security Policy for loads
526         initiated by an element in a user agent shadow tree. See <https://bugs.webkit.org/show_bug.cgi?id=155505> for
527         more details. Additionally, simplified code that determined whether to request the media resource or error out
528         by coalescing two conditional expressions into one conditional on whether we have a loader and substituted
529         nullptr for 0.
530
531 2016-03-16  Chris Dumez  <cdumez@apple.com>
532
533         Unreviewed, rolling out r198235, r198240, r198241, and
534         r198252.
535
536         Causing crashes on ARM
537
538         Reverted changesets:
539
540         "Remove compile time define for SEPARATED_HEAP"
541         https://bugs.webkit.org/show_bug.cgi?id=155508
542         http://trac.webkit.org/changeset/198235
543
544         "Gardening: build fix after r198235."
545         http://trac.webkit.org/changeset/198240
546
547         "Build fix."
548         http://trac.webkit.org/changeset/198241
549
550         "Rename performJITMemcpy to something more inline with our
551         normal webkit function names"
552         https://bugs.webkit.org/show_bug.cgi?id=155525
553         http://trac.webkit.org/changeset/198252
554
555 2016-03-16  Jiewen Tan  <jiewen_tan@apple.com>
556
557         URL Parsing should signal failure for illegal IDN
558         https://bugs.webkit.org/show_bug.cgi?id=154945
559         <rdar://problem/8014795>
560
561         Reviewed by Brent Fulgham.
562
563         WebCore::URL will now invalidate URLs with illegal IDN. And functions inside WebCoreNSURLExtras.h
564         that deal with IDN mapping will now return nil to signal error.
565
566         Test: fast/url/invalid-idn.html
567
568         * platform/URL.cpp:
569         (WebCore::isSchemeFirstChar):
570         (WebCore::URL::init):
571         (WebCore::appendEncodedHostname):
572         (WebCore::encodeHostnames):
573         (WebCore::encodeRelativeString):
574         * platform/mac/WebCoreNSURLExtras.h:
575         * platform/mac/WebCoreNSURLExtras.mm:
576         (WebCore::mapHostNameWithRange):
577         (WebCore::hostNameNeedsDecodingWithRange):
578         (WebCore::hostNameNeedsEncodingWithRange):
579         (WebCore::decodeHostNameWithRange):
580         (WebCore::encodeHostNameWithRange):
581         (WebCore::decodeHostName):
582         (WebCore::encodeHostName):
583         (WebCore::collectRangesThatNeedMapping):
584         (WebCore::mapHostNames):
585         (WebCore::URLWithData):
586         (WebCore::dataWithUserTypedString):
587         (WebCore::URLWithUserTypedString):
588         (WebCore::URLWithUserTypedStringDeprecated):
589         (WebCore::userVisibleString):
590
591 2016-03-16  Antti Koivisto  <antti@apple.com>
592
593         Don't invalidate style unnecessarily when setting inline style cssText
594         https://bugs.webkit.org/show_bug.cgi?id=155541
595         rdar://problem/23318893
596
597         Reviewed by Simon Fraser.
598
599         We currently invalidate style when cssText is set whether the style declaration changed or not.
600
601         Based on a patch by Simon.
602
603         Test: fast/css/style-invalidation-inline-csstext.html
604
605         * css/PropertySetCSSStyleDeclaration.cpp:
606         (WebCore::PropertySetCSSStyleDeclaration::cssText):
607         (WebCore::PropertySetCSSStyleDeclaration::setCssText):
608
609             Invalidate only if the parsed style changed.
610
611         * css/StyleProperties.cpp:
612         (WebCore::MutableStyleProperties::parseDeclaration):
613
614             Compare the original and new style after parsing, return result.
615
616         * css/StyleProperties.h:
617
618 2016-03-16  Carlos Garcia Campos  <cgarcia@igalia.com>
619
620         REGRESSION(r195661): [GTK] very slow scrolling
621         https://bugs.webkit.org/show_bug.cgi?id=155334
622
623         Reviewed by Sergio Villar Senin.
624
625         Fix smooth scrolling behaviour change after r195661.
626
627         * platform/ScrollAnimationSmooth.cpp:
628         (WebCore::getAnimationParametersForGranularity): Fix a typo,
629         animationTime for pixel granularity should be 11 * tickTime.
630         (WebCore::ScrollAnimationSmooth::animateScroll): Previous code
631         reset all the data except the visibleLenght, so keep it in the
632         PerAxisData after the reset.
633
634 2016-03-16  Commit Queue  <commit-queue@webkit.org>
635
636         Unreviewed, rolling out r196803.
637         https://bugs.webkit.org/show_bug.cgi?id=155534
638
639         Introduced several rendering issues in popular websites
640         (Requested by KaL on #webkit).
641
642         Reverted changeset:
643
644         "[GTK] Limit the number of tiles according to the visible
645         area"
646         https://bugs.webkit.org/show_bug.cgi?id=126122
647         http://trac.webkit.org/changeset/196803
648
649 2016-03-15  Zalan Bujtas  <zalan@apple.com>
650
651         Remove overflow: -webkit-marquee
652         https://bugs.webkit.org/show_bug.cgi?id=155517
653         <rdar://problem/25028481>
654
655         Reviewed by Simon Fraser.
656
657         This patch is based on Blink patch from jchaffraix@chromium.org (https://src.chromium.org/viewvc/blink?revision=151756&view=revision)
658
659         * css/CSSParser.cpp:
660         (WebCore::isValidKeywordPropertyAndValue):
661         * css/CSSPrimitiveValueMappings.h:
662         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Deleted.
663         (WebCore::CSSPrimitiveValue::operator EOverflow): Deleted.
664         * css/CSSValueKeywords.in:
665         * css/StyleResolver.cpp:
666         (WebCore::StyleResolver::adjustRenderStyle):
667         * css/html.css:
668         (marquee): Deleted.
669         * rendering/RenderBox.cpp:
670         (WebCore::RenderBox::sizesLogicalWidthToFitContent):
671         * rendering/RenderLayer.cpp:
672         (WebCore::RenderLayer::scrollTo):
673         (WebCore::RenderLayer::updateScrollInfoAfterLayout):
674         (WebCore::RenderLayer::calculateClipRects):
675         * rendering/RenderLayer.h:
676         * rendering/RenderMarquee.h:
677         * rendering/style/RenderStyleConstants.h:
678
679 2016-03-15  Joanmarie Diggs  <jdiggs@igalia.com>
680
681         AX: Expose pointers to SVG elements referenced by aria-labelledby
682         https://bugs.webkit.org/show_bug.cgi?id=155481
683
684         Reviewed by Chris Fleizach.
685
686         Expose elements referenced by aria-labelledby via ATK_RELATION_LABELLED_BY.
687         Stop calling the supportsARIA* methods before getting the elements referred
688         to by the associated ARIA property in the accessible wrapper for ATK and
689         the inspector: Getting the elements will be just as fast when there are no
690         such elements, and faster when there are.
691
692         Modified the w3c-svg-name-calculation.html test to include AXTitleUIElement
693         in its output.
694
695         * accessibility/AccessibilityObject.cpp:
696         (WebCore::AccessibilityObject::supportsARIAAttributes):
697         (WebCore::AccessibilityObject::ariaElementsFromAttribute): Added.
698         (WebCore::AccessibilityObject::ariaControlsElements): Added.
699         (WebCore::AccessibilityObject::ariaDescribedByElements): Added.
700         (WebCore::AccessibilityObject::ariaFlowToElements): Added.
701         (WebCore::AccessibilityObject::ariaLabelledByElements): Added.
702         (WebCore::AccessibilityObject::ariaOwnsElements): Added.
703         * accessibility/AccessibilityObject.h:
704         (WebCore::AccessibilityObject::ariaOwnsElements): No longer virtual.
705         (WebCore::AccessibilityObject::supportsARIAFlowTo): Deleted.
706         (WebCore::AccessibilityObject::ariaFlowToElements): No longer virtual.
707         (WebCore::AccessibilityObject::supportsARIADescribedBy): Deleted.
708         (WebCore::AccessibilityObject::ariaDescribedByElements): No longer virtual.
709         (WebCore::AccessibilityObject::supportsARIAControls): Deleted.
710         (WebCore::AccessibilityObject::ariaControlsElements): No longer virtual.
711         * accessibility/AccessibilityRenderObject.cpp:
712         (WebCore::AccessibilityRenderObject::ariaElementsFromAttribute): Moved to AccessibilityObject.
713         (WebCore::AccessibilityRenderObject::supportsARIAFlowTo): Deleted.
714         (WebCore::AccessibilityRenderObject::ariaFlowToElements): Moved to AccessibilityObject.
715         (WebCore::AccessibilityRenderObject::supportsARIADescribedBy): Deleted.
716         (WebCore::AccessibilityRenderObject::ariaDescribedByElements): Moved to AccessibilityObject.
717         (WebCore::AccessibilityRenderObject::supportsARIAControls): Deleted.
718         (WebCore::AccessibilityRenderObject::ariaControlsElements): Moved to AccessibilityObject.
719         (WebCore::AccessibilityRenderObject::ariaOwnsElements): Moved to AccessibilityObject.
720         * accessibility/AccessibilityRenderObject.h:
721         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
722         (setAtkRelationSetFromCoreObject):
723         * inspector/InspectorDOMAgent.cpp:
724         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
725
726 2016-03-15  Simon Fraser  <simon.fraser@apple.com>
727
728         Occasional crash under GraphicsContext::platformContext when dragging Google maps
729         https://bugs.webkit.org/show_bug.cgi?id=155521
730         rdar://problem/24357307
731
732         Reviewed by Tim Horton.
733
734         It's possible for createDragImageForSelection() to return a null image, if the bounds
735         of the selection are an empty rect. That would cause a crash under convertImageToBitmap()
736         because a zero-sized ShareableBitmap will return a null GraphicsContext.
737         
738         To avoid this, early return from DragController::startDrag() if the dragImage is null.
739         
740         I wasn't able to come up with a test for this.
741
742         * page/DragController.cpp:
743         (WebCore::DragController::startDrag):
744
745 2016-03-15  Tim Horton  <timothy_horton@apple.com>
746
747         iOS <attachment> element should allow customization of action text color
748         https://bugs.webkit.org/show_bug.cgi?id=155513
749         <rdar://problem/24805991>
750
751         Reviewed by Simon Fraser.
752
753         Test: fast/attachment/attachment-action.html
754
755         * css/html.css:
756         (attachment):
757         On iOS (the only place it is used), <attachment> color should default to system blue.
758
759         * rendering/RenderThemeIOS.mm:
760         (WebCore::attachmentActionColor):
761         (WebCore::AttachmentInfo::AttachmentInfo):
762         Make use of the <attachment>'s CSS color for the action text.
763         This is a little weird because there are multiple bits of text in an
764         <attachment>, but only the action text ever changes color.
765
766 2016-03-15  Zalan Bujtas  <zalan@apple.com>
767
768         Delay HTMLFormControlElement::focus() call until after layout is finished.
769         https://bugs.webkit.org/show_bug.cgi?id=155503
770         <rdar://problem/24046635>
771
772         Reviewed by Simon Fraser.
773
774         Calling focus on a form element can trigger arbitrary JS code which could interfere with
775         the ongoing layout. 
776         This patch delays HTMLFormControlElement::focus() call until after layout is finished.
777         If we are currently not in the middle of a layout, HTMLFormControlElement::focus() is delayed until
778         after style resolution is done. 
779
780         Covered by LayoutTests/fast/dom/adopt-node-crash-2.html
781
782         * accessibility/AccessibilityObject.cpp:
783         (WebCore::AccessibilityObject::updateBackingStore):
784         * dom/Document.cpp:
785         (WebCore::Document::updateStyleIfNeeded):
786         (WebCore::Document::updateLayout):
787         (WebCore::Document::updateLayoutIfDimensionsOutOfDate):
788         * html/HTMLEmbedElement.cpp:
789         (WebCore::HTMLEmbedElement::renderWidgetLoadingPlugin):
790         * html/HTMLFormControlElement.cpp:
791         (WebCore::HTMLFormControlElement::didAttachRenderers):
792         * page/FrameView.cpp:
793         (WebCore::FrameView::layout):
794         (WebCore::FrameView::queuePostLayoutCallback):
795         (WebCore::FrameView::flushPostLayoutTasksQueue):
796         (WebCore::FrameView::performPostLayoutTasks):
797         (WebCore::FrameView::sendResizeEventIfNeeded):
798         * page/FrameView.h:
799         * rendering/RenderBox.cpp:
800         (WebCore::RenderBox::imageChanged):
801         * rendering/RenderLayer.cpp:
802         (WebCore::RenderLayer::scrollTo):
803
804 2016-03-15  Oliver Hunt  <oliver@apple.com>
805
806         Remove compile time define for SEPARATED_HEAP
807         https://bugs.webkit.org/show_bug.cgi?id=155508
808
809         Reviewed by Mark Lam.
810
811         Remove the feature define.
812
813         * Configurations/FeatureDefines.xcconfig:
814
815 2016-03-15  Chris Dumez  <cdumez@apple.com>
816
817         Restore pre-r197244 behavior on Mac
818         https://bugs.webkit.org/show_bug.cgi?id=155507
819         <rdar://problem/25174132>
820
821         Reviewed by Gavin Barraclough.
822
823         <http://trac.webkit.org/changeset/197244> changed the session restore
824         behavior to disallow stale content on all platforms except iOS.
825         We would also like to maintain the behavior on Mac for performance
826         reasons and consistency between iOS and Mac.
827
828         * loader/FrameLoader.cpp:
829         (WebCore::FrameLoader::loadDifferentDocumentItem):
830
831 2016-03-15  Tim Horton  <timothy_horton@apple.com>
832
833         <attachment> on iOS isn't quite vertically centered
834         https://bugs.webkit.org/show_bug.cgi?id=155502
835         <rdar://problem/24805991>
836
837         Reviewed by Beth Dakin.
838
839         No new tests; there are existing tests that will be enabled shortly.
840
841         * rendering/RenderThemeIOS.mm:
842         (WebCore::AttachmentInfo::AttachmentInfo):
843         We were overcounting the total height of the attachment content by one margin, because each item
844         would add in its margin, including the last one. Remove one margin.
845
846 2016-03-15  Chris Fleizach  <cfleizach@apple.com>
847
848         AX: certain elements not included in accessibility tree
849         https://bugs.webkit.org/show_bug.cgi?id=155480
850
851         Reviewed by Beth Dakin.
852
853         This test case exposed a hole in the nextSibling logic where you can get into a state where we skip content.
854         The fix is to check if an inline element continuation has no sibling, to fall back on to the parent case to see if that has a sibling.
855
856         Test: accessibility/double-nested-inline-element-missing-from-tree.html
857
858         * accessibility/AccessibilityRenderObject.cpp:
859         (WebCore::AccessibilityRenderObject::nextSibling):
860
861 2016-03-15  Chris Dumez  <cdumez@apple.com>
862
863         Unreviewed, rolling out r198203.
864
865         Favorites view is no longer loading on iOS
866
867         Reverted changeset:
868
869         "URL Parsing should signal failure for illegal IDN"
870         https://bugs.webkit.org/show_bug.cgi?id=154945
871         http://trac.webkit.org/changeset/198203
872
873 2016-03-15  Tim Horton  <timothy_horton@apple.com>
874
875         <attachment> on iOS should use short and emphasized fonts
876         https://bugs.webkit.org/show_bug.cgi?id=155485
877         <rdar://problem/24805991>
878
879         Reviewed by Simon Fraser.
880
881         No new tests; there are existing tests that will be enabled shortly.
882
883         * rendering/RenderThemeIOS.mm:
884         (WebCore::attachmentActionFont):
885         (WebCore::attachmentTitleFont):
886         (WebCore::attachmentSubtitleFont):
887         (WebCore::AttachmentInfo::buildTitleLines):
888         (WebCore::AttachmentInfo::buildSingleLine):
889         (WebCore::AttachmentInfo::AttachmentInfo):
890         No need for UIFonts, we can use CoreText, and that allows us to ask for the
891         correct Short and Emphasized variants that we need.
892
893 2016-03-15  Antti Koivisto  <antti@apple.com>
894
895         REGRESSION (196383): Class change invalidation does not handle :not correctly
896         https://bugs.webkit.org/show_bug.cgi?id=155493
897         <rdar://problem/24846762>
898
899         Reviewed by Andreas Kling.
900
901         We fail to invalidate bar style in
902
903             :not(.foo) bar { }
904
905         when class foo is added or removed.
906
907         There is a logic error in the invalidation code. It assumes that class addition can only make new selectors match
908         and removal make them not match. This is not true when :not is present.
909
910         * style/AttributeChangeInvalidation.h:
911         (WebCore::Style::AttributeChangeInvalidation::AttributeChangeInvalidation):
912         * style/ClassChangeInvalidation.cpp:
913         (WebCore::Style::ClassChangeInvalidation::invalidateStyle):
914
915             Invalidate style and collect full set of rules that may affect descendant style.
916
917         (WebCore::Style::ClassChangeInvalidation::invalidateDescendantStyle):
918
919             Invalidate with this set both before and after committing the changes.
920
921         (WebCore::Style::ClassChangeInvalidation::computeClassChange): Deleted.
922         * style/ClassChangeInvalidation.h:
923         (WebCore::Style::ClassChangeInvalidation::ClassChangeInvalidation):
924         (WebCore::Style::ClassChangeInvalidation::~ClassChangeInvalidation):
925
926 2016-03-14  Jer Noble  <jer.noble@apple.com>
927
928         Video elements with autoplay do not begin playing when scrolling into view if InvisibleAutoplayNotPermitted is set.
929         https://bugs.webkit.org/show_bug.cgi?id=155468
930
931         Reviewed by Eric Carlson.
932
933         Test: media/video-restricted-invisible-autoplay-allowed-when-visible.html
934
935         A few bugs came together to cause this behavior. We were not telling the media session that we were going to begin
936         the autoplaying state, we were not restoring the correct state when the interruption ended, and we were not checking
937         to see if we could actually play correctly when the interruption ended.
938
939         * html/HTMLMediaElement.cpp:
940         (WebCore::HTMLMediaElement::prepareForLoad):
941         (WebCore::HTMLMediaElement::canTransitionFromAutoplayToPlay):
942         (WebCore::HTMLMediaElement::setReadyState):
943         (WebCore::HTMLMediaElement::resumeAutoplaying):
944         (WebCore::HTMLMediaElement::updateShouldPlay):
945         (WebCore::elementCanTransitionFromAutoplayToPlay): Deleted.
946         * html/HTMLMediaElement.h:
947         * platform/audio/PlatformMediaSession.cpp:
948         (WebCore::PlatformMediaSession::endInterruption):
949
950 2016-03-15  Manuel Rego Casasnovas  <rego@igalia.com>
951
952         [css-grid] Rename GridCoordinate to GridArea
953         https://bugs.webkit.org/show_bug.cgi?id=155489
954
955         Reviewed by Sergio Villar Senin.
956
957         As the comment in GridCoordinate states,
958         it actually represents a grid area as it stores
959         the initial and final positions in both axis (columns and rows).
960
961         Someone can think about a grid coordinate just like a single cell.
962         However this class was representing an area of several cells.
963
964         On top of that the "grid area" concept is defined in the spec:
965         https://drafts.csswg.org/css-grid/#grid-area-concept
966
967         No new tests, no change of behavior.
968
969         * WebCore.xcodeproj/project.pbxproj:
970         * css/CSSGridTemplateAreasValue.cpp:
971         (WebCore::stringForPosition):
972         * css/CSSGridTemplateAreasValue.h:
973         * css/CSSParser.cpp:
974         (WebCore::CSSParser::parseGridTemplateAreasRow):
975         * css/CSSParser.h:
976         * rendering/RenderGrid.cpp:
977         (WebCore::RenderGrid::GridIterator::nextEmptyGridArea):
978         (WebCore::RenderGrid::insertItemIntoGrid):
979         (WebCore::RenderGrid::placeItemsOnGrid):
980         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
981         (WebCore::RenderGrid::createEmptyGridAreaAtSpecifiedPositionsOutsideGrid):
982         (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
983         (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
984         (WebCore::RenderGrid::clearGrid):
985         (WebCore::RenderGrid::cachedGridArea):
986         (WebCore::RenderGrid::cachedGridSpan):
987         * rendering/RenderGrid.h:
988         * rendering/style/GridArea.h: Renamed from Source/WebCore/rendering/style/GridCoordinate.h.
989         (WebCore::GridSpan::untranslatedDefiniteGridSpan):
990         (WebCore::GridSpan::translatedDefiniteGridSpan):
991         (WebCore::GridSpan::indefiniteGridSpan):
992         (WebCore::GridSpan::operator==):
993         (WebCore::GridSpan::integerSpan):
994         (WebCore::GridSpan::untranslatedResolvedInitialPosition):
995         (WebCore::GridSpan::untranslatedResolvedFinalPosition):
996         (WebCore::GridSpan::resolvedInitialPosition):
997         (WebCore::GridSpan::resolvedFinalPosition):
998         (WebCore::GridSpan::GridSpanIterator::GridSpanIterator):
999         (WebCore::GridSpan::GridSpanIterator::operator unsigned&):
1000         (WebCore::GridSpan::GridSpanIterator::operator*):
1001         (WebCore::GridSpan::begin):
1002         (WebCore::GridSpan::end):
1003         (WebCore::GridSpan::isTranslatedDefinite):
1004         (WebCore::GridSpan::isIndefinite):
1005         (WebCore::GridSpan::translate):
1006         (WebCore::GridSpan::GridSpan):
1007         (WebCore::GridArea::GridArea):
1008         (WebCore::GridArea::operator==):
1009         (WebCore::GridArea::operator!=):
1010         * rendering/style/GridPositionsResolver.cpp:
1011         * rendering/style/StyleGridData.h:
1012
1013 2016-03-15  Joonghun Park  <jh718.park@samsung.com>
1014
1015         [GTK] Remove duplicate HashMap traversal and unneeded reference count churn in DataObjectGtk::forClipboard
1016         https://bugs.webkit.org/show_bug.cgi?id=155470
1017
1018         Reviewed by Carlos Garcia Campos.
1019
1020         No new tests, no new behaviours.
1021
1022         * platform/gtk/DataObjectGtk.cpp:
1023         (WebCore::DataObjectGtk::forClipboard):
1024
1025 2016-03-15  Manuel Rego Casasnovas  <rego@igalia.com>
1026
1027         [css-grid] Rename GridResolvedPosition to GridPositionsResolver
1028         https://bugs.webkit.org/show_bug.cgi?id=155486
1029
1030         Reviewed by Sergio Villar Senin.
1031
1032         GridResolvedPosition is not storing a position (track or line) anymore.
1033         Currently it's just a class wrapping the methods to resolve
1034         grid positions from style.
1035         Renamed the class to avoid confusions.
1036
1037         No new tests, no change of behavior.
1038
1039         * CMakeLists.txt:
1040         * WebCore.xcodeproj/project.pbxproj:
1041         * rendering/RenderGrid.cpp:
1042         (WebCore::RenderGrid::placeItemsOnGrid):
1043         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
1044         (WebCore::RenderGrid::createEmptyGridAreaAtSpecifiedPositionsOutsideGrid):
1045         (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
1046         (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
1047         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
1048         * rendering/RenderGrid.h:
1049         * rendering/style/GridCoordinate.h:
1050         * rendering/style/GridPositionsResolver.cpp: Renamed from Source/WebCore/rendering/style/GridResolvedPosition.cpp.
1051         (WebCore::isColumnSide):
1052         (WebCore::isStartSide):
1053         (WebCore::initialPositionSide):
1054         (WebCore::finalPositionSide):
1055         (WebCore::gridLinesForSide):
1056         (WebCore::implicitNamedGridLineForSide):
1057         (WebCore::GridPositionsResolver::isNonExistentNamedLineOrArea):
1058         (WebCore::adjustGridPositionsFromStyle):
1059         (WebCore::GridPositionsResolver::explicitGridColumnCount):
1060         (WebCore::GridPositionsResolver::explicitGridRowCount):
1061         (WebCore::explicitGridSizeForSide):
1062         (WebCore::lookAheadForNamedGridLine):
1063         (WebCore::lookBackForNamedGridLine):
1064         (WebCore::resolveNamedGridLinePositionFromStyle):
1065         (WebCore::definiteGridSpanWithNamedLineSpanAgainstOpposite):
1066         (WebCore::resolveNamedGridLinePositionAgainstOppositePosition):
1067         (WebCore::resolveGridPositionAgainstOppositePosition):
1068         (WebCore::GridPositionsResolver::spanSizeForAutoPlacedItem):
1069         (WebCore::resolveGridPositionFromStyle):
1070         (WebCore::GridPositionsResolver::resolveGridPositionsFromStyle):
1071         * rendering/style/GridPositionsResolver.h: Renamed from Source/WebCore/rendering/style/GridResolvedPosition.h.
1072         * rendering/style/StyleAllInOne.cpp:
1073
1074 2016-03-15  Miguel Gomez  <magomez@igalia.com>
1075
1076         Leak: Accelerated ImageBufferCairo doesn't destroy the used textures
1077         https://bugs.webkit.org/show_bug.cgi?id=155431
1078
1079         Reviewed by Žan Doberšek.
1080
1081         When using the Cairo backend, add a destructor to ImageBufferData and use it to destroy the
1082         textures created if the buffer is being accelerated.
1083
1084         No new tests, already covered by existing ones.
1085
1086         * platform/graphics/cairo/ImageBufferCairo.cpp:
1087         (WebCore::ImageBufferData::ImageBufferData):
1088         Store the renderingMode flag.
1089         (WebCore::ImageBufferData::~ImageBufferData):
1090         Destroy gl resources if renderingMode is accelerated.
1091         (WebCore::ImageBuffer::ImageBuffer):
1092         Pass renderingMode to the data class and use it fro checks instead of the function parameter.
1093         * platform/graphics/cairo/ImageBufferDataCairo.h:
1094         Add destructor and a renderingMode flag.
1095
1096 2016-03-15  Jiewen Tan  <jiewen_tan@apple.com>
1097
1098         URL Parsing should signal failure for illegal IDN
1099         https://bugs.webkit.org/show_bug.cgi?id=154945
1100         <rdar://problem/8014795>
1101
1102         Reviewed by Brent Fulgham.
1103
1104         WebCore::URL will now invalidate URLs with illegal IDN. And functions inside WebCoreNSURLExtras.h
1105         that deal with IDN mapping will now return nil to signal error.
1106
1107         Test: fast/url/invalid-idn.html
1108
1109         * platform/URL.cpp:
1110         (WebCore::isSchemeFirstChar):
1111         (WebCore::URL::init):
1112         (WebCore::appendEncodedHostname):
1113         (WebCore::encodeHostnames):
1114         (WebCore::encodeRelativeString):
1115         * platform/mac/WebCoreNSURLExtras.h:
1116         * platform/mac/WebCoreNSURLExtras.mm:
1117         (WebCore::mapHostNameWithRange):
1118         (WebCore::hostNameNeedsDecodingWithRange):
1119         (WebCore::hostNameNeedsEncodingWithRange):
1120         (WebCore::decodeHostNameWithRange):
1121         (WebCore::encodeHostNameWithRange):
1122         (WebCore::decodeHostName):
1123         (WebCore::encodeHostName):
1124         (WebCore::collectRangesThatNeedMapping):
1125         (WebCore::mapHostNames):
1126         (WebCore::URLWithData):
1127         (WebCore::dataWithUserTypedString):
1128         (WebCore::URLWithUserTypedString):
1129         (WebCore::URLWithUserTypedStringDeprecated):
1130         (WebCore::userVisibleString):
1131
1132 2016-03-15  Carlos Garcia Campos  <cgarcia@igalia.com>
1133
1134         REGRESSION (r197724): [GTK] Web Inspector: Images being blocked by CSP 2.0
1135         https://bugs.webkit.org/show_bug.cgi?id=155432
1136
1137         Reviewed by Darin Adler.
1138
1139         The GTK+ port Web Inspector uses GResources for all internal
1140         resources (images, fonts, scripts, etc.) that are now blocked by
1141         the CSP. GResouces are like data URLs in practice, so we should
1142         always allow them.
1143
1144         * page/csp/ContentSecurityPolicySourceList.cpp:
1145         (WebCore::ContentSecurityPolicySourceList::isProtocolAllowedByStar):
1146
1147 2016-03-14  Alex Christensen  <achristensen@webkit.org>
1148
1149         Fix WinCairo build after r198195.
1150
1151         * platform/network/NetworkingContext.h:
1152         curl networking now uses NetworkingContext::storageSession.  That's everybody!
1153
1154 2016-03-14  Per Arne Vollan  <peavo@outlook.com>
1155
1156         [WinCairo] Compile fix.
1157         https://bugs.webkit.org/show_bug.cgi?id=155463
1158
1159         Reviewed by Alex Christensen.
1160
1161         Get the NetworkStorageSession object from the document in the same way as other platforms do.
1162
1163         * loader/CookieJar.cpp:
1164         (WebCore::storageSession):
1165
1166 2016-03-14  Tim Horton  <timothy_horton@apple.com>
1167
1168         <attachment> on iOS should paint its progress indicator instead of a green square
1169         https://bugs.webkit.org/show_bug.cgi?id=155482
1170         <rdar://problem/24805991>
1171
1172         Reviewed by Simon Fraser.
1173
1174         No new tests; there are existing tests that will be enabled shortly.
1175
1176         * rendering/RenderThemeIOS.mm:
1177         (WebCore::getAttachmentProgress):
1178         Clamp progress to 0-1.
1179
1180         (WebCore::paintAttachmentProgress):
1181         Paint a pie.
1182
1183 2016-03-14  Chris Dumez  <cdumez@apple.com>
1184
1185         Unreviewed, rolling out r197981.
1186
1187         Caused a massive PLT regression on Mac.
1188
1189         Reverted changeset:
1190
1191         "Font antialiasing (smoothing) changes when elements are
1192         rendered into compositing layers"
1193         https://bugs.webkit.org/show_bug.cgi?id=23364
1194         http://trac.webkit.org/changeset/197981
1195
1196 2016-03-14  Chris Dumez  <cdumez@apple.com>
1197
1198         Unreviewed, rolling out r198145.
1199
1200         This attempt to disable the feature did not fix the PLT
1201         regression
1202
1203         Reverted changeset:
1204
1205         "Regression(r197981): Huge regression on Mac PLT"
1206         https://bugs.webkit.org/show_bug.cgi?id=155443
1207         http://trac.webkit.org/changeset/198145
1208
1209 2016-03-14  Sam Weinig  <sam@webkit.org>
1210
1211         Remove errant space.
1212
1213         * page/UserContentController.cpp:
1214
1215 2016-03-14  Sam Weinig  <sam@webkit.org>
1216
1217         Fix the windows build.
1218
1219         * page/UserContentController.cpp:
1220
1221 2016-03-14  Sam Weinig  <sam@webkit.org>
1222
1223         Add a baseURL parameter to _WKUserStyleSheet
1224         https://bugs.webkit.org/show_bug.cgi?id=155219
1225
1226         Reviewed by Tim Horton.
1227
1228         - Moves to a model for user content where instead of each page having a WebCore::UserContentController
1229           object, we have an abstract WebCore::UserContentProvider interface that can be implemented at the WebKit
1230           level. For now, legacy WebKit continues to use the old UserContentController, which implements 
1231           WebCore::UserContentProvider, and WebKit2 implements its own implementation so it can store additional
1232           state.
1233
1234         * WebCore.xcodeproj/project.pbxproj:
1235         Add new files.
1236
1237         * dom/ExtensionStyleSheets.cpp:
1238         (WebCore::ExtensionStyleSheets::updateInjectedStyleSheetCache):
1239         Switch to using forEachUserStyleSheet on the UserContentProvider.
1240
1241         * html/HTMLMediaElement.cpp:
1242         (WebCore::HTMLMediaElement::loadResource):
1243         Remove null check now that we always have a UserContentProvider.
1244
1245         * loader/EmptyClients.cpp:
1246         (WebCore::fillWithEmptyClients):
1247         * loader/EmptyClients.h:
1248         Add new EmptyClients.
1249
1250         * loader/FrameLoader.cpp:
1251         (WebCore::FrameLoader::loadResourceSynchronously):
1252         Remove null check now that we always have a UserContentProvider.
1253
1254         * loader/PingLoader.cpp:
1255         (WebCore::processContentExtensionRulesForLoad):
1256         Remove null check now that we always have a UserContentProvider.
1257
1258         * loader/ResourceLoader.cpp:
1259         (WebCore::ResourceLoader::willSendRequestInternal):
1260         Remove null check now that we always have a UserContentProvider.
1261
1262         * loader/cache/CachedResourceLoader.cpp:
1263         (WebCore::CachedResourceLoader::requestResource):
1264         Remove null check now that we always have a UserContentProvider.
1265
1266         * page/DOMWindow.cpp:
1267         (WebCore::DOMWindow::shouldHaveWebKitNamespaceForWorld):
1268         Remove null checks now that we always have a UserContentProvider, and userMessageHandlerDescriptors
1269         returns a reference.
1270
1271         (WebCore::DOMWindow::open):
1272         Remove null check now that we always have a UserContentProvider.
1273
1274         * page/Frame.cpp:
1275         (WebCore::Frame::injectUserScripts):
1276         Simplify by lifting document check out of the main loop and using forEachUserScript.
1277
1278         * page/Page.cpp:
1279         (WebCore::Page::Page):
1280         (WebCore::Page::~Page):
1281         (WebCore::Page::userContentProvider):
1282         (WebCore::Page::setUserContentProvider):
1283         (WebCore::Page::setUserContentController): Deleted.
1284         * page/Page.h:
1285         (WebCore::Page::userContentController): Deleted.
1286         * page/PageConfiguration.h:
1287         Store the UserContentProvider in a Ref, and require PageConfigurations to provide one. This
1288         removes a bunch of null checks and simplifies the code.
1289
1290         * page/UserContentController.cpp:
1291         (WebCore::UserContentController::~UserContentController):
1292         (WebCore::UserContentController::forEachUserScript):
1293         (WebCore::UserContentController::forEachUserStyleSheet):
1294         (WebCore::UserContentController::addUserScript):
1295         (WebCore::UserContentController::removeUserScript):
1296         (WebCore::UserContentController::removeUserScripts):
1297         (WebCore::UserContentController::addUserStyleSheet):
1298         (WebCore::UserContentController::removeUserStyleSheet):
1299         (WebCore::UserContentController::removeUserStyleSheets):
1300         (WebCore::UserContentController::addUserMessageHandlerDescriptor):
1301         (WebCore::UserContentController::removeUserMessageHandlerDescriptor):
1302         (WebCore::UserContentController::addUserContentExtension):
1303         (WebCore::UserContentController::removeUserContentExtension):
1304         (WebCore::UserContentController::removeAllUserContentExtensions):
1305         (WebCore::UserContentController::removeAllUserContent):
1306         (WebCore::UserContentController::addPage): Deleted.
1307         (WebCore::UserContentController::removePage): Deleted.
1308         (WebCore::contentExtensionsEnabled): Deleted.
1309         (WebCore::UserContentController::processContentExtensionRulesForLoad): Deleted.
1310         (WebCore::UserContentController::actionsForResourceLoad): Deleted.
1311         * page/UserContentController.h:
1312         (WebCore::UserContentController::userScripts): Deleted.
1313         (WebCore::UserContentController::userStyleSheets): Deleted.
1314         (WebCore::UserContentController::userMessageHandlerDescriptors): Deleted.
1315         Add inheritance from UserContentProvider and simplify things by removing unique_ptrs
1316         that were holding the member variables. There is usually only one UserContentController
1317         so having these in unique_ptrs doesn't make much sense.
1318         
1319         * page/UserContentProvider.cpp: Added.
1320         (WebCore::UserContentProvider::UserContentProvider):
1321         (WebCore::UserContentProvider::~UserContentProvider):
1322         (WebCore::UserContentProvider::addPage):
1323         (WebCore::UserContentProvider::removePage):
1324         (WebCore::UserContentProvider::invalidateInjectedStyleSheetCacheInAllFramesInAllPages):
1325         (WebCore::contentExtensionsEnabled):
1326         (WebCore::UserContentProvider::processContentExtensionRulesForLoad):
1327         (WebCore::UserContentProvider::actionsForResourceLoad):
1328         * page/UserContentProvider.h: Added.
1329         Add abstract class for providing user content and add some helpers on it.
1330
1331         * page/UserMessageHandlerDescriptor.h:
1332         (WebCore::UserMessageHandlerDescriptor::create):
1333         (WebCore::UserMessageHandlerDescriptor::client):
1334         (WebCore::UserMessageHandlerDescriptor::invalidateClient):
1335         * page/UserMessageHandlersNamespace.cpp:
1336         (WebCore::UserMessageHandlersNamespace::handler):
1337         Simplify now that userContentProvider() and userMessageHandlerDescriptors() are references.
1338
1339 2016-03-14  Enrica Casucci  <enrica@apple.com>
1340
1341         iOS: RTFD format is not available in the pasteboard after copy/cut.
1342         https://bugs.webkit.org/show_bug.cgi?id=155477
1343         rdar://problem/23500600
1344
1345         Reviewed by Tim Horton.
1346
1347         WebKit is using UTTypeRTFD instead of UTTypeFlatRTFD that is the
1348         proper RTFD format for pastedboard. I also discovered that, when
1349         we create the NSTextAttachment in the NSAttributedString we produce
1350         from the DOM range, we are not generating a file name with the
1351         appropriate extension for the MIME type. The iOS specific implementation
1352         of the MIMETypeRegistry functions were empty.
1353         There is no need to have a differentiation between OS X and iOS, so
1354         we now have only one file called MIMETypeRegistryCocoa.mm.
1355
1356         * WebCore.xcodeproj/project.pbxproj:
1357         * platform/cocoa/MIMETypeRegistryCocoa.mm: Added.
1358         (WebCore::MIMETypeRegistry::getMIMETypeForExtension):
1359         (WebCore::MIMETypeRegistry::getExtensionsForMIMEType):
1360         (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType):
1361         (WebCore::MIMETypeRegistry::isApplicationPluginMIMEType):
1362         * platform/ios/MIMETypeRegistryIOS.mm: Removed.
1363         * platform/ios/PasteboardIOS.mm:
1364         (WebCore::Pasteboard::read):
1365         (WebCore::Pasteboard::supportedPasteboardTypes):
1366         (WebCore::Pasteboard::hasData):
1367         * platform/ios/PlatformPasteboardIOS.mm:
1368         (WebCore::PlatformPasteboard::write):
1369         * platform/mac/MIMETypeRegistryMac.mm: Removed.
1370
1371 2016-03-14  Daniel Bates  <dabates@apple.com>
1372
1373         Web Inspector: Display Content Security Policy hash in details sidebar for script and style elements
1374         https://bugs.webkit.org/show_bug.cgi?id=155466
1375         <rdar://problem/25152480>
1376
1377         Reviewed by Joseph Pecoraro and Timothy Hatcher.
1378
1379         For convenience, display the SHA-256 Content Security Policy (CSP) hash in the node details
1380         sidebar for the selected HTML script element or HTML style element. A CSP script hash is
1381         only applicable to inline JavaScript scripts. Therefore, we will display a hash for HTML
1382         script elements only if they do not have a src attribute.
1383
1384         Tests: inspector/dom/csp-big5-hash.html
1385                inspector/dom/csp-hash.html
1386
1387         * inspector/InspectorDOMAgent.cpp:
1388         (WebCore::computeContentSecurityPolicySHA256Hash): Added.
1389         (WebCore::InspectorDOMAgent::buildObjectForNode): For an applicable HTML script- or style-
1390         element, pass the computed SHA-256 CSP hash to the Inspector front end.
1391
1392 2016-03-14  Joonghun Park  <jh718.park@samsung.com>
1393
1394         Purge PassRefPtr from ArrayBuffer, ArchiveResource, Pasteboard, LegacyWebArchive and DataObjectGtk
1395         https://bugs.webkit.org/show_bug.cgi?id=150497
1396
1397         Reviewed by Darin Adler.
1398
1399         No new tests, no new behaviours.
1400
1401         * Modules/indexeddb/IDBGetResult.h:
1402         (WebCore::IDBGetResult::IDBGetResult):
1403         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1404         (WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
1405         * Modules/mediastream/RTCDataChannel.cpp:
1406         (WebCore::RTCDataChannel::didReceiveRawData):
1407         * dom/MessageEvent.cpp:
1408         (WebCore::MessageEvent::MessageEvent):
1409         * dom/MessageEvent.h:
1410         * editing/Editor.cpp:
1411         (WebCore::Editor::selectedRange):
1412         * editing/Editor.h:
1413         * editing/FrameSelection.h:
1414         (WebCore::FrameSelection::toNormalizedRange):
1415         * editing/VisiblePosition.cpp:
1416         (WebCore::makeRange):
1417         * editing/VisiblePosition.h:
1418         * editing/VisibleSelection.cpp:
1419         (WebCore::VisibleSelection::toNormalizedRange):
1420         * editing/VisibleSelection.h:
1421         * editing/VisibleUnits.cpp:
1422         (WebCore::enclosingTextUnitOfGranularity):
1423         (WebCore::wordRangeFromPosition):
1424         (WebCore::rangeExpandedByCharactersInDirectionAtWordBoundary):
1425         (WebCore::rangeExpandedAroundPositionByCharacters):
1426         * editing/VisibleUnits.h:
1427         * editing/cocoa/HTMLConverter.mm:
1428         (HTMLConverter::_addAttachmentForElement):
1429         (fileWrapperForURL):
1430         * editing/efl/EditorEfl.cpp:
1431         (WebCore::Editor::webContentFromPasteboard):
1432         * editing/gtk/EditorGtk.cpp:
1433         (WebCore::createFragmentFromPasteboardData):
1434         (WebCore::Editor::webContentFromPasteboard):
1435         * editing/ios/EditorIOS.mm:
1436         (WebCore::dataInRTFDFormat):
1437         (WebCore::dataInRTFFormat):
1438         (WebCore::Editor::selectionInWebArchiveFormat):
1439         (WebCore::Editor::WebContentReader::addFragment):
1440         (WebCore::Editor::WebContentReader::readWebArchive):
1441         (WebCore::Editor::WebContentReader::readRTFD):
1442         (WebCore::Editor::WebContentReader::readRTF):
1443         (WebCore::Editor::WebContentReader::readImage):
1444         (WebCore::Editor::WebContentReader::readURL):
1445         (WebCore::Editor::webContentFromPasteboard):
1446         (WebCore::Editor::pasteWithPasteboard):
1447         (WebCore::Editor::createFragmentAndAddResources):
1448         (WebCore::Editor::createFragmentForImageResourceAndAddResource):
1449         * editing/mac/EditorMac.mm:
1450         (WebCore::Editor::selectionInWebArchiveFormat):
1451         (WebCore::Editor::adjustedSelectionRange):
1452         (WebCore::dataInRTFDFormat):
1453         (WebCore::dataInRTFFormat):
1454         (WebCore::Editor::dataSelectionForPasteboard):
1455         (WebCore::Editor::WebContentReader::readWebArchive):
1456         (WebCore::Editor::WebContentReader::readRTFD):
1457         (WebCore::Editor::WebContentReader::readRTF):
1458         (WebCore::Editor::WebContentReader::readImage):
1459         (WebCore::Editor::WebContentReader::readURL):
1460         (WebCore::Editor::webContentFromPasteboard):
1461         (WebCore::Editor::createFragmentForImageResourceAndAddResource):
1462         (WebCore::Editor::createFragmentAndAddResources):
1463         * editing/win/EditorWin.cpp:
1464         (WebCore::createFragmentFromPlatformData):
1465         (WebCore::Editor::webContentFromPasteboard):
1466         * inspector/InspectorPageAgent.cpp:
1467         (WebCore::InspectorPageAgent::archive):
1468         * loader/DocumentLoader.cpp:
1469         (WebCore::DocumentLoader::mainResourceData):
1470         (WebCore::DocumentLoader::maybeCreateArchive):
1471         (WebCore::DocumentLoader::addArchiveResource):
1472         (WebCore::DocumentLoader::mainResource):
1473         * loader/DocumentLoader.h:
1474         * loader/FrameLoader.cpp:
1475         (WebCore::FrameLoader::loadArchive):
1476         * loader/SubstituteData.h:
1477         (WebCore::SubstituteData::SubstituteData):
1478         (WebCore::SubstituteData::isValid):
1479         * loader/SubstituteResource.h:
1480         (WebCore::SubstituteResource::data):
1481         (WebCore::SubstituteResource::SubstituteResource):
1482         * loader/appcache/ApplicationCacheGroup.cpp:
1483         (WebCore::ApplicationCacheGroup::didReceiveResponse):
1484         (WebCore::ApplicationCacheGroup::didReceiveData):
1485         (WebCore::ApplicationCacheGroup::didFail):
1486         (WebCore::ApplicationCacheGroup::didReceiveManifestData):
1487         (WebCore::ApplicationCacheGroup::didFinishLoadingManifest):
1488         * loader/appcache/ApplicationCacheHost.cpp:
1489         (WebCore::ApplicationCacheHost::maybeLoadMainResource):
1490         (WebCore::ApplicationCacheHost::maybeLoadSynchronously):
1491         (WebCore::ApplicationCacheHost::maybeLoadFallbackSynchronously):
1492         * loader/appcache/ApplicationCacheResource.cpp:
1493         (WebCore::ApplicationCacheResource::ApplicationCacheResource):
1494         (WebCore::ApplicationCacheResource::deliver):
1495         (WebCore::ApplicationCacheResource::estimatedSizeInStorage):
1496         * loader/appcache/ApplicationCacheResource.h:
1497         (WebCore::ApplicationCacheResource::create):
1498         * loader/appcache/ApplicationCacheStorage.cpp:
1499         (WebCore::ApplicationCacheStorage::store):
1500         (WebCore::ApplicationCacheStorage::writeDataToUniqueFileInDirectory):
1501         * loader/appcache/ApplicationCacheStorage.h:
1502         * loader/archive/ArchiveFactory.cpp:
1503         (WebCore::archiveFactoryCreate):
1504         (WebCore::ArchiveFactory::create):
1505         * loader/archive/ArchiveFactory.h:
1506         * loader/archive/ArchiveResource.cpp:
1507         (WebCore::ArchiveResource::ArchiveResource):
1508         (WebCore::ArchiveResource::create):
1509         * loader/archive/ArchiveResource.h:
1510         * loader/archive/ArchiveResourceCollection.cpp:
1511         (WebCore::ArchiveResourceCollection::addResource):
1512         * loader/archive/ArchiveResourceCollection.h:
1513         * loader/archive/cf/LegacyWebArchive.cpp:
1514         (WebCore::LegacyWebArchive::createPropertyListRepresentation):
1515         (WebCore::LegacyWebArchive::createResource):
1516         (WebCore::LegacyWebArchive::create):
1517         (WebCore::LegacyWebArchive::createFromSelection):
1518         * loader/archive/cf/LegacyWebArchive.h:
1519         * loader/archive/mhtml/MHTMLArchive.cpp:
1520         (WebCore::MHTMLArchive::create):
1521         * loader/archive/mhtml/MHTMLArchive.h:
1522         * loader/archive/mhtml/MHTMLParser.cpp:
1523         (WebCore::MHTMLParser::parseArchive):
1524         (WebCore::MHTMLParser::parseArchiveWithHeader):
1525         (WebCore::MHTMLParser::parseNextPart):
1526         * loader/archive/mhtml/MHTMLParser.h:
1527         * loader/cache/CachedImage.cpp:
1528         (WebCore::CachedImage::didAddClient):
1529         * loader/icon/IconDatabase.cpp:
1530         (WebCore::loadDefaultIconRecord):
1531         * loader/icon/IconRecord.cpp:
1532         (WebCore::IconRecord::setImageData):
1533         * loader/icon/IconRecord.h:
1534         * platform/Pasteboard.h:
1535         * platform/PasteboardStrategy.h:
1536         * platform/PlatformPasteboard.h:
1537         * platform/SharedBuffer.cpp:
1538         (WebCore::SharedBuffer::createArrayBuffer):
1539         (WebCore::utf8Buffer):
1540         * platform/SharedBuffer.h:
1541         (WebCore::SharedBuffer::create):
1542         * platform/cf/SharedBufferCF.cpp:
1543         (WebCore::SharedBuffer::wrapCFData):
1544         * platform/cocoa/NetworkExtensionContentFilter.mm:
1545         (WebCore::NetworkExtensionContentFilter::replacementData):
1546         * platform/cocoa/ParentalControlsContentFilter.mm:
1547         (WebCore::ParentalControlsContentFilter::replacementData):
1548         * platform/graphics/Image.cpp:
1549         (WebCore::Image::setData):
1550         * platform/graphics/Image.h:
1551         * platform/gtk/DataObjectGtk.cpp:
1552         (WebCore::DataObjectGtk::forClipboard):
1553         * platform/gtk/DataObjectGtk.h:
1554         (WebCore::DataObjectGtk::create):
1555         * platform/gtk/PasteboardGtk.cpp:
1556         (WebCore::Pasteboard::Pasteboard):
1557         (WebCore::Pasteboard::dataObject):
1558         * platform/ios/PasteboardIOS.mm:
1559         (WebCore::Pasteboard::read):
1560         * platform/ios/PlatformPasteboardIOS.mm:
1561         (WebCore::PlatformPasteboard::bufferForType):
1562         (WebCore::PlatformPasteboard::readBuffer):
1563         * platform/mac/PasteboardMac.mm:
1564         (WebCore::writeFileWrapperAsRTFDAttachment):
1565         (WebCore::Pasteboard::read):
1566         * platform/mac/PlatformPasteboardMac.mm:
1567         (WebCore::PlatformPasteboard::bufferForType):
1568         * platform/mac/SharedBufferMac.mm:
1569         (WebCore::SharedBuffer::wrapNSData):
1570         (WebCore::SharedBuffer::createFromReadingFile):
1571         * platform/network/MIMEHeader.cpp:
1572         (WebCore::retrieveKeyValuePairs):
1573         (WebCore::MIMEHeader::parseHeader):
1574         * platform/network/MIMEHeader.h:
1575         * platform/soup/SharedBufferSoup.cpp:
1576         (WebCore::SharedBuffer::wrapSoupBuffer):
1577         * platform/win/ClipboardUtilitiesWin.cpp:
1578         (WebCore::fragmentFromFilenames):
1579         (WebCore::fragmentFromCFHTML):
1580         (WebCore::fragmentFromHTML):
1581         * platform/win/ClipboardUtilitiesWin.h:
1582         * platform/win/PasteboardWin.cpp:
1583         (WebCore::Pasteboard::documentFragment):
1584
1585 2016-03-14  Oliver Hunt  <oliver@apple.com>
1586
1587         Temporarily disable the separated heap.
1588         https://bugs.webkit.org/show_bug.cgi?id=155472
1589
1590         Reviewed by Geoffrey Garen.
1591
1592         Temporarily disable this.
1593
1594         * Configurations/FeatureDefines.xcconfig:
1595
1596 2016-03-10  Antonio Gomes  <tonikitoo@webkit.org>
1597
1598         Selecting with shift+drag results in unexpected drag-n-drop
1599         https://bugs.webkit.org/show_bug.cgi?id=155314
1600
1601         Reviewed by Darin Adler.
1602
1603         Test: editing/selection/shift-drag-selection-no-drag-n-drop.html
1604
1605         Whenever user tries to extend an existing text selection by dragging the mouse
1606         (left button hold) with shift key pressed, WebKit enters drag-n-drop mode.
1607         This behavior does not match common editing behavior out there, including other
1608         browsers' (Firefox, Opera/Presto and IE).
1609
1610         Patch changes WebKit so that whenever one extends a selection with mouse
1611         and shift key pressed off of a #text node, it does not enter drag-n-drop mode.
1612
1613         Additionally, patch also adds some further tests to ensure that when
1614         selection is extended off of either a link or an image, drag-n-drop does
1615         get triggered, no matter if shift key is pressed.
1616
1617         * page/EventHandler.cpp:
1618         (WebCore::EventHandler::handleMousePressEvent):
1619
1620 2016-03-14  Brent Fulgham  <bfulgham@apple.com>
1621
1622         REGRESSION (r197114): Crash in WebCore::MediaDevicesRequest::didCompletePermissionCheck
1623         https://bugs.webkit.org/show_bug.cgi?id=155453
1624         <rdar://problem/24879447>
1625
1626         Reviewed by Daniel Bates.
1627
1628         Tested by fast/mediastream/enumerating-crash.html.
1629
1630         * Modules/mediastream/MediaDevicesRequest.cpp:
1631         (WebCore::MediaDevicesRequest::didCompletePermissionCheck): Prevent UserMediaPermissionCheck object from being
1632         destroyed before the method completes.
1633
1634 2016-03-14  Simon Fraser  <simon.fraser@apple.com>
1635
1636         Fix crash when reloading a page using requestAnimationFrame on iOS
1637         https://bugs.webkit.org/show_bug.cgi?id=155465
1638         rdar://problem/25100202
1639
1640         Reviewed by Tim Horton.
1641
1642         On iOS, it's possible for all clients for a DisplayRefreshMonitor
1643         to be unregistered, but still get a subsequent displayDidRefresh() for that monitor.
1644         In this case, we would remove(notFound) which release-asserts.
1645         
1646         Fix by just checking for notFound.
1647         
1648         Unable to test because requestAnimationFrame doesn't work in the simulator.
1649
1650         * platform/graphics/DisplayRefreshMonitorManager.cpp:
1651         (WebCore::DisplayRefreshMonitorManager::displayDidRefresh):
1652
1653 2016-03-14  Per Arne Vollan  <peavo@outlook.com>
1654
1655         [WinCairo][MediaFoundation] Implement float versions of MediaPlayer methods.
1656         https://bugs.webkit.org/show_bug.cgi?id=155357
1657
1658         Reviewed by Brent Fulgham.
1659
1660         It is better to implement the float versions of some of the MediaPlayer methods,
1661         since the default implementation of the double versions is to call the float version.
1662         Also added override keyword to overridden methods.
1663
1664         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
1665         (WebCore::MediaPlayerPrivateMediaFoundation::seeking):
1666         (WebCore::MediaPlayerPrivateMediaFoundation::seek):
1667         (WebCore::MediaPlayerPrivateMediaFoundation::setRate):
1668         (WebCore::MediaPlayerPrivateMediaFoundation::duration):
1669         (WebCore::MediaPlayerPrivateMediaFoundation::currentTime):
1670         (WebCore::MediaPlayerPrivateMediaFoundation::seekDouble): Deleted.
1671         (WebCore::MediaPlayerPrivateMediaFoundation::setRateDouble): Deleted.
1672         (WebCore::MediaPlayerPrivateMediaFoundation::durationDouble): Deleted.
1673         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
1674
1675 2016-03-14  Tim Horton  <timothy_horton@apple.com>
1676
1677         Revert r194125 and r194186: We're going to fix this a different way.
1678
1679         * page/EventHandler.cpp:
1680         (WebCore::EventHandler::clear):
1681         * page/EventHandler.h:
1682
1683 2016-03-14  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1684
1685         [Fetch API] FetchLoader should check for empty bodies
1686         https://bugs.webkit.org/show_bug.cgi?id=155440
1687
1688         Reviewed by Darin Adler.
1689
1690         Covered by added tests.
1691
1692         * Modules/fetch/FetchLoader.cpp:
1693         (WebCore::FetchLoader::didFinishLoading): returning empty array buffer/empty string if no data received during loading.
1694
1695 2016-03-14  Chris Dumez  <cdumez@apple.com>
1696
1697         Regression(r197981): Huge regression on Mac PLT
1698         https://bugs.webkit.org/show_bug.cgi?id=155443
1699         <rdar://problem/25113391>
1700
1701         Reviewed by Gavin Barraclough.
1702
1703         We have experience a huge regression on Mac PLT after r197981, so
1704         disable the feature until the performance issue is resolved.
1705
1706         * platform/graphics/ca/GraphicsLayerCA.cpp:
1707         (WebCore::GraphicsLayer::supportsSmoothedLayerText):
1708
1709 2016-03-14  Chris Vienneau  <chris.vno@outlook.com>
1710
1711         PingHandle delete's itself but pointer is still used by handleDataURL
1712         https://bugs.webkit.org/show_bug.cgi?id=154752
1713         <rdar://problem/24872347>
1714
1715         Reviewed by Alex Christensen.
1716
1717         When a PingHandle is destroyed, we should tell its client so that the client can clear the pointer it
1718         holds to the element to avoid accidentally attempting to use deallocated memory.
1719
1720         The ResourceHandle's client member may be null after "didReceiveResponse" is called. We should confirm
1721         the client is still valid after these calls.
1722
1723         * platform/network/DataURL.cpp:
1724         (WebCore::handleDataURL): Check the client pointer before using it.
1725         * platform/network/PingHandle.h:
1726         (WebCore::PingHandle::~PingHandle): Notify the client we are being destroyed.
1727         * platform/platform/network/ResourceHandle.h:
1728
1729 2016-03-14  Zalan Bujtas  <zalan@apple.com>
1730
1731         Negative outline offset could break curved outline-style: auto
1732         https://bugs.webkit.org/show_bug.cgi?id=155416
1733
1734         Reviewed by Tim Horton.
1735
1736         When radius becomes negative the rounded rect could end up being un-renderable -> no rounded corners at all.
1737
1738         Test: fast/inline/hidpi-outline-auto-negative-offset-with-border-radius.html
1739
1740         * platform/graphics/PathUtilities.cpp:
1741         (WebCore::adjustedtRadiiForHuggingCurve):
1742
1743 2016-03-14  Zalan Bujtas  <zalan@apple.com>
1744
1745         [Outline: auto] Fractional radius value could result in non-renderable rounded border.
1746         https://bugs.webkit.org/show_bug.cgi?id=155420
1747
1748         Reviewed by Tim Horton.
1749
1750         RoundedRect::pixelSnappedRoundedRectForPainting ensures that the rounded rect is always renderable.
1751
1752         Test: fast/inline/hidpi-outline-auto-with-fractional-radius.html
1753
1754         * platform/graphics/PathUtilities.cpp:
1755         (WebCore::PathUtilities::pathWithShrinkWrappedRectsForOutline):
1756         * platform/graphics/PathUtilities.h:
1757         * rendering/RenderElement.cpp:
1758         (WebCore::RenderElement::paintFocusRing):
1759
1760 2016-03-14  Zalan Bujtas  <zalan@apple.com>
1761
1762         Outline: auto has sharp corners with single line contenteditable.
1763         https://bugs.webkit.org/show_bug.cgi?id=155418
1764
1765         Reviewed by Tim Horton.
1766
1767         Multiple rectangles assumed multiline content and it broke bottomLeft and bottomRight corner check.
1768         This patch adds fast path for polygons with 4 corners.
1769
1770         Test: fast/inline/hidpi-outline-auto-with-one-focusring-rect.html
1771
1772         * platform/graphics/PathUtilities.cpp:
1773         (WebCore::cornerType):
1774         (WebCore::cornerTypeForMultiline):
1775         (WebCore::rectFromPolygon):
1776         (WebCore::PathUtilities::pathWithShrinkWrappedRectsForOutline):
1777
1778 2016-03-14  Joanmarie Diggs  <jdiggs@igalia.com>
1779
1780         [AX] SVG element with child desc not exposed
1781         https://bugs.webkit.org/show_bug.cgi?id=155374
1782
1783         Reviewed by Darin Adler.
1784
1785         Covered by the accessibility/w3c-svg-roles.html test, which was updated.
1786
1787         AccessibilitySVGRoot is now a subclass of AccessibilitySVGElement, which
1788         exposes SVG elements with a child desc element as per the specification.
1789         Also made existing protected methods private.
1790
1791         * accessibility/AccessibilitySVGElement.h:
1792         * accessibility/AccessibilitySVGRoot.cpp:
1793         (WebCore::AccessibilitySVGRoot::AccessibilitySVGRoot):
1794         (WebCore::AccessibilitySVGRoot::parentObject):
1795         * accessibility/AccessibilitySVGRoot.h:
1796
1797 2016-03-14  Alexey Proskuryakov  <ap@apple.com>
1798
1799         Build fix.
1800
1801         * Modules/fetch/FetchBodyOwner.cpp:
1802         (WebCore::FetchBodyOwner::loadedBlobAsText):
1803
1804 2016-03-14  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1805
1806         [Fetch API] Implement data resolution for blob stored in Body
1807         https://bugs.webkit.org/show_bug.cgi?id=155359
1808
1809         Reviewed by Darin Adler.
1810
1811         Introducing FetchLoader as a wrapper around ThreadableLoader to load resources.
1812         FetchLoader can retrieve data as text or array buffer. It only supports blob currently.
1813
1814         Introducing FetchLoaderClient interface and FetchBodyOwner::BlobLoader as specifc blob loader client.
1815
1816         Covered by existing rebased tests.
1817
1818         * CMakeLists.txt:
1819         * Modules/fetch/FetchBody.cpp:
1820         (WebCore::FetchBody::loadingType):
1821         (WebCore::FetchBody::loadedAsArrayBuffer):
1822         (WebCore::FetchBody::loadedAsText):
1823         * Modules/fetch/FetchBody.h:
1824         * Modules/fetch/FetchBodyOwner.cpp: Added.
1825         (WebCore::FetchBodyOwner::FetchBodyOwner):
1826         (WebCore::FetchBodyOwner::loadBlob):
1827         (WebCore::FetchBodyOwner::finishBlobLoading):
1828         (WebCore::FetchBodyOwner::blobLoadingFailed):
1829         (WebCore::FetchBodyOwner::BlobLoader::didReceiveResponse):
1830         * Modules/fetch/FetchBodyOwner.h:
1831         (WebCore::FetchBodyOwner::loadedBlobAsText):
1832         (WebCore::FetchBodyOwner::loadedBlobAsArrayBuffer):
1833         (WebCore::FetchBodyOwner::blobLoadingSucceeded):
1834         * Modules/fetch/FetchLoader.cpp: Added.
1835         (WebCore::FetchLoader::start):
1836         (WebCore::FetchLoader::FetchLoader):
1837         (WebCore::FetchLoader::stop):
1838         (WebCore::FetchLoader::didReceiveResponse):
1839         (WebCore::FetchLoader::didReceiveData):
1840         (WebCore::FetchLoader::didFinishLoading):
1841         (WebCore::FetchLoader::didFail):
1842         * Modules/fetch/FetchLoader.h: Added.
1843         * Modules/fetch/FetchLoaderClient.h: Added.
1844         (WebCore::FetchLoaderClient::~FetchLoaderClient):
1845         (WebCore::FetchLoaderClient::didReceiveResponse):
1846         (WebCore::FetchLoaderClient::didFinishLoadingAsText):
1847         (WebCore::FetchLoaderClient::didFinishLoadingAsArrayBuffer):
1848         * WebCore.xcodeproj/project.pbxproj:
1849
1850 2016-03-14  Frederic Wang  <fwang@igalia.com>
1851
1852         Make MathML colspan/rowspan consistent with HTML table cells.
1853         https://bugs.webkit.org/show_bug.cgi?id=150253
1854
1855         Reviewed by Martin Robinson.
1856
1857         Test: mathml/rowspan-crash.xhtml
1858
1859         We make MathMLElement::colSpan and MathMLElement::rowSpan consistent with the corresponding functions in HTMLTableCellElement.cpp.
1860         These functions now return unsigned integers, use the same parsing functions and set a maximum for rowspan.
1861         This latter change fixes crash/timeout with large values of rowspan.
1862
1863         * mathml/MathMLElement.cpp: Include HTMLParserIdioms to use limitToOnlyHTMLNonNegative.
1864         (WebCore::MathMLElement::colSpan): Use unsigned integer and limitToOnlyHTMLNonNegative.
1865         (WebCore::MathMLElement::rowSpan): ditto. We also use the same maximum limit as HTMLTableCellElement.
1866         * mathml/MathMLElement.h: Make colSpan and rowSpan return unsigned integers.
1867
1868 2016-03-14  Tomas Popela  <tpopela@redhat.com>
1869
1870         Enable GSS-Negotiate support in libsoup
1871         https://bugs.webkit.org/show_bug.cgi?id=155354
1872
1873         Reviewed by Carlos Garcia Campos.
1874
1875         Enable the SOUP_TYPE_AUTH_NEGOTIATE feature if libsoup was compiled
1876         with the GSS-Negotiate support.
1877
1878         * platform/network/soup/SoupNetworkSession.cpp:
1879         (WebCore::SoupNetworkSession::SoupNetworkSession):
1880
1881 2016-03-14  Ryosuke Niwa  <rniwa@webkit.org>
1882
1883         Add slotchange event
1884         https://bugs.webkit.org/show_bug.cgi?id=155424
1885         <rdar://problem/24997534>
1886
1887         Reviewed by Antti Koivisto.
1888
1889         Added `slotchange` event as discussed on https://github.com/w3c/webcomponents/issues/288.
1890
1891         While the exact semantics of it could still evolve over time, this patch implements as
1892         an asynchronous event that fires on a slot element whenever its distributed nodes change
1893         (flattened assigned nodes):
1894         http://w3c.github.io/webcomponents/spec/shadow/#dfn-distributed-nodes
1895
1896         Since inserting or removing an element from a shadow host could needs to enqueue this event
1897         on the right slot element, this patch moves the invalidation point of element removals and
1898         insertions from Element::childrenChanged to Element::insertedInto and Element::removedFrom.
1899         Text nodes are still invalidated at Element::childrenChanged for performance reasons
1900         since it could only appear within a default slot element.
1901
1902         Because this more fine-grained invalidation needs to be overridden by HTMLDetailsElement,
1903         we now subclass SlotAssignment in HTMLDetailsElement instead of passing in a std::function.
1904
1905         Test: fast/shadow-dom/slotchange-event.html
1906
1907         * dom/Document.cpp:
1908         (WebCore::Document::enqueueSlotchangeEvent): Added.
1909         * dom/Document.h:
1910         * dom/Element.cpp:
1911         (WebCore::Element::attributeChanged): Call hostChildElementDidChangeSlotAttr.
1912         (WebCore::Element::insertedInto): Call hostChildElementDidChange.
1913         (WebCore::Element::removedFrom): Ditto.
1914         (WebCore::Element::childrenChanged): Don't invalidate the slots on ElementInserted and
1915         ElementRemoved since they're now done in Element::insertedInto and Element::removedFrom.
1916         * dom/Event.cpp:
1917         (WebCore::Event::scoped): slotchange event is scoped.
1918         * dom/EventNames.h: Added eventNames().slotchange.
1919         * dom/ShadowRoot.cpp:
1920         (WebCore::ShadowRoot::invalidateSlotAssignments): Deleted.
1921         (WebCore::ShadowRoot::invalidateDefaultSlotAssignments): Deleted.
1922         * dom/ShadowRoot.h:
1923         (ShadowRoot): Added more fine-grained invalidators, mirroring changes to SlotAssignment.
1924         * dom/SlotAssignment.cpp:
1925         (WebCore::SlotAssignment::SlotAssignment): Removed a variant that takes SlotNameFunction
1926         since HTMLDetailsElement now subclasses SlotAssignment.
1927         (WebCore::SlotAssignment::~SlotAssignment): Added now that the class is virtual.
1928         (WebCore::recursivelyFireSlotChangeEvent): Added.
1929         (WebCore::SlotAssignment::didChangeSlot): Added. Invalidates the style tree only if there
1930         is a corresponding slot element, and fires slotchange event. When the slot element we found
1931         in this shadow tree is assigned to a slot element inside an inner shadow tree, recursively
1932         fire slotchange event on each such inner slots.
1933         (WebCore::SlotAssignment::hostChildElementDidChange): Added. Update the matching slot when
1934         an element is inserted or removed under a shadow host.
1935         (WebCore::SlotAssignment::assignedNodesForSlot): Removed the superfluous early exit to an
1936         release assert since addSlotElementByName should always create a SlotInfo for each element.
1937         (WebCore::SlotAssignment::slotNameForHostChild): Added. This is the equivalent of old
1938         m_slotNameFunction which DetailsSlotAssignment overrides.
1939         (WebCore::SlotAssignment::invalidateDefaultSlot): Deleted.
1940         (WebCore::SlotAssignment::findFirstSlotElement): Added an assertion. slotInfo.element must
1941         be nullptr if elementCount is 0, and elementCount must be 0 if slotInfo.element is nullptr
1942         after calling resolveAllSlotElements, which traverses the entire shadow tree to find all
1943         slot elements.
1944         (WebCore::SlotAssignment::assignSlots):
1945         * dom/SlotAssignment.h: Implemented inline functions of ShadowRoot here to avoid including
1946         SlotAssignment.h in ShadowRoot.h. Not inlining them results in extra function calls for all
1947         builtin elements with shadow root without slot elements, which impacts performance.
1948         (WebCore::ShadowRoot::didRemoveAllChildrenOfShadowHost): Added.
1949         (WebCore::ShadowRoot::didChangeDefaultSlot): Added.
1950         (WebCore::ShadowRoot::hostChildElementDidChange): Added.
1951         (WebCore::ShadowRoot::hostChildElementDidChangeSlotAttribute): Added.
1952         (WebCore::ShadowRoot::innerSlotDidChange):
1953         * html/HTMLDetailsElement.cpp:
1954         (WebCore::DetailsSlotAssignment): Added. Subclasses SlotAssignment to override
1955         hostChildElementDidChange and slotNameForHostChild.
1956         (WebCore::DetailsSlotAssignment::hostChildElementDidChange): Added. We don't check if this
1957         is the first summary element since we don't know the answer when this function is called
1958         inside Element::removedFrom.
1959         (WebCore::DetailsSlotAssignment::slotNameForHostChild): Renamed from slotNameFunction. Also
1960         removed the code to return nullAtom when details element is not open as that messes up new
1961         fine-grained invalidation. Insert/remove the slot element in parseAttribute instead.
1962         (WebCore::HTMLDetailsElement::didAddUserAgentShadowRoot): Don't insert the slot element for
1963         the summary since the details element is not open now.
1964         (WebCore::HTMLDetailsElement::parseAttribute): Remove and insert the slot element for the
1965         summary here instead of changing the behavior of slotNameForHostChild.
1966         * html/HTMLDetailsElement.h:
1967         * html/HTMLSlotElement.cpp:
1968         (WebCore::HTMLSlotElement::enqueueSlotChangeEvent): Added. Enqueues a new slotchange event
1969         if we haven't done so for this element yet.
1970         (WebCore::HTMLSlotElement::dispatchEvent): Added. Clear m_hasEnqueuedSlotChangeEvent when
1971         dispatching a slotchange event so that a subsequent call to enqueueSlotChangeEvent would
1972         enqueue a new event. Note scripts call EventTarget::dispatchEventForBindings instead.
1973         * html/HTMLSlotElement.h:
1974
1975 2016-03-14  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1976
1977         Introduce CallWith=Document in binding generator
1978         https://bugs.webkit.org/show_bug.cgi?id=155358
1979
1980         Reviewed by Darin Adler.
1981
1982         Covered by existing tests and binding test.
1983
1984         * Modules/notifications/Notification.cpp:
1985         (WebCore::Notification::permission): Taking a Document& instead of ScriptExecutionContext&.
1986         (WebCore::Notification::requestPermission): Ditto.
1987         * Modules/notifications/Notification.h:
1988         * Modules/notifications/Notification.idl: Using CallWith=Document.
1989         * bindings/scripts/CodeGeneratorJS.pm: Adding support for CallWith=Document and changed name from scriptContext to context.
1990         (GenerateCallWith):
1991         (GenerateConstructorDefinition):
1992         * bindings/scripts/IDLAttributes.txt: Adding support for CallWith=Document.
1993         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
1994         (webkit_dom_test_obj_with_document_argument):
1995         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
1996         * bindings/scripts/test/JS/JSTestInterface.cpp:
1997         (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
1998         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
1999         * bindings/scripts/test/JS/JSTestObj.cpp:
2000         (WebCore::jsTestObjWithScriptExecutionContextAttribute):
2001         (WebCore::jsTestObjWithScriptExecutionContextAttributeRaises):
2002         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttribute):
2003         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
2004         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
2005         (WebCore::setJSTestObjWithScriptExecutionContextAttribute):
2006         (WebCore::setJSTestObjWithScriptExecutionContextAttributeRaises):
2007         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute):
2008         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
2009         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
2010         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContext):
2011         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptState):
2012         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException):
2013         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces):
2014         (WebCore::jsTestObjPrototypeFunctionWithDocumentArgument):
2015         * bindings/scripts/test/ObjC/DOMTestObj.h:
2016         * bindings/scripts/test/ObjC/DOMTestObj.mm:
2017         (-[DOMTestObj withDocumentArgument]):
2018         * bindings/scripts/test/TestObj.idl: Adding binding test.
2019         * page/DOMWindow.cpp:
2020         (WebCore::DOMWindow::focus): Taking a Document& instead of ScriptExecutionContext&.
2021         (WebCore::DOMWindow::close): Ditto.
2022         * page/DOMWindow.h:
2023         * page/DOMWindow.idl:
2024         * page/History.cpp:
2025         (WebCore::History::back): Ditto.
2026         (WebCore::History::forward): Ditto.
2027         (WebCore::History::go): Ditto.
2028         * page/History.h:
2029         * page/History.idl:
2030         * testing/Internals.cpp:
2031         (WebCore::InspectorStubFrontend::closeWindow): Calling DOMWindow::close() directly.
2032
2033 2016-03-13  Joseph Pecoraro  <pecoraro@apple.com>
2034
2035         Remove ENABLE(ES6_TEMPLATE_LITERAL_SYNTAX) guards
2036         https://bugs.webkit.org/show_bug.cgi?id=155417
2037
2038         Reviewed by Yusuke Suzuki.
2039
2040         * Configurations/FeatureDefines.xcconfig:
2041
2042 2016-03-13  Sam Weinig  <sam@webkit.org>
2043
2044         Implement unprivileged execCommand("copy") and execCommand("cut")
2045         <rdar://problem/24354406>
2046         https://bugs.webkit.org/show_bug.cgi?id=146336
2047
2048         Reviewed by Dean Jackson.
2049
2050         Test: editing/execCommand/clipboard-access-with-user-gesture.html
2051
2052         * WebCore.xcodeproj/project.pbxproj:
2053         Add new files.
2054
2055         * editing/ClipboardAccessPolicy.h:
2056         Added.
2057
2058         * editing/EditorCommand.cpp:
2059         (WebCore::defaultValueForSupportedCopyCut):
2060         (WebCore::supportedCopyCut):
2061         Match other browsers and allow the copy and cut commands
2062         to be executed when there is a user gesture.
2063
2064         * page/Settings.h:
2065         Add include of ClipboardAccessPolicy.h.
2066
2067         * page/Settings.in:
2068         Add new setting for ClipboardAccessPolicy
2069
2070 2016-03-13  Ryosuke Niwa  <rniwa@webkit.org>
2071
2072         REGRESSION (r190840): crash inside details element's slotNameFunction
2073         https://bugs.webkit.org/show_bug.cgi?id=155388
2074
2075         Reviewed by Antti Koivisto.
2076
2077         The bug was caused by HTMLDetailsElement::isActiveSummary calling findAssignedSlot with a summary element
2078         inside the shadow tree of the detials element. Fixed it by existing early when the summary element passed
2079         to isActiveSummary is not a direct child of the details element.
2080
2081         Test: fast/html/details-summary-tabindex-crash.html
2082
2083         * dom/ShadowRoot.cpp:
2084         (WebCore::ShadowRoot::findAssignedSlot): Added an assertion for regression testing.
2085         * dom/SlotAssignment.cpp:
2086         (WebCore::SlotAssignment::findAssignedSlot): Removed the superfluous call to assignSlots added in r190840.
2087         There is no need to update the slot assignments here (entires in m_slots are added or removed by
2088         addSlotElementByName or removeSlotElementByName and assignSlots only updates assignedNodes in each SlotInfo
2089         which is never used in this function or findFirstSlotElement.
2090         * html/HTMLDetailsElement.cpp:
2091         (WebCore::HTMLDetailsElement::isActiveSummary): Fixed the bug.
2092
2093 2016-03-13  Antti Koivisto  <antti@apple.com>
2094
2095         ComposedTreeIterator fails to traverse slots if root is shadow host
2096         https://bugs.webkit.org/show_bug.cgi?id=155407
2097
2098         Reviewed by Darin Adler.
2099
2100         Test: fast/shadow-dom/composed-tree-shadow-subtree.html
2101
2102         * dom/ComposedTreeIterator.cpp:
2103         (WebCore::ComposedTreeIterator::ComposedTreeIterator):
2104
2105             Traversal functions assume m_contextStack is deeper than 1 before they need to enter slot traversal code paths.
2106             Call initializeContextStack in case of shadow host which does the right thing.
2107
2108         (WebCore::ComposedTreeIterator::traverseSiblingInSlot):
2109         (WebCore::composedTreeAsText):
2110
2111             Add option to include pointers as debugging aid.
2112
2113         * dom/ComposedTreeIterator.h:
2114         (WebCore::composedTreeChildren):
2115
2116 2016-03-12  Sam Weinig  <sam@webkit.org>
2117
2118         WebKit can easily crash below NetworkSession::dataTaskForIdentifier() with NSURLSession enabled
2119         <rdar://problem/25129946>
2120         https://bugs.webkit.org/show_bug.cgi?id=155401
2121
2122         Reviewed by Alex Christensen.
2123
2124         Add a SessionID as a member of NetworkStorageSession. This allows us to avoid having HashMaps
2125         to map between the two types.
2126
2127         * platform/network/NetworkStorageSession.h:
2128         (WebCore::NetworkStorageSession::sessionID):
2129         (WebCore::NetworkStorageSession::credentialStorage):
2130         (WebCore::NetworkStorageSession::platformSession):
2131         * platform/network/NetworkStorageSessionStub.cpp:
2132         (WebCore::NetworkStorageSession::NetworkStorageSession):
2133         (WebCore::NetworkStorageSession::context):
2134         (WebCore::NetworkStorageSession::createPrivateBrowsingSession):
2135         (WebCore::defaultSession):
2136         (WebCore::NetworkStorageSession::defaultStorageSession):
2137         (WebCore::NetworkStorageSession::switchToNewTestingSession):
2138         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
2139         (WebCore::NetworkStorageSession::NetworkStorageSession):
2140         (WebCore::NetworkStorageSession::switchToNewTestingSession):
2141         (WebCore::NetworkStorageSession::defaultStorageSession):
2142         (WebCore::NetworkStorageSession::createPrivateBrowsingSession):
2143         * platform/network/soup/NetworkStorageSessionSoup.cpp:
2144         (WebCore::NetworkStorageSession::NetworkStorageSession):
2145         (WebCore::NetworkStorageSession::defaultStorageSession):
2146         (WebCore::NetworkStorageSession::createPrivateBrowsingSession):
2147         (WebCore::NetworkStorageSession::switchToNewTestingSession):
2148         (WebCore::NetworkStorageSession::soupNetworkSession):
2149
2150 2016-03-13  Jon Lee  <jonlee@apple.com>
2151
2152         getUserMedia requests from the main frame should be treated the same as requests from an iframe with the same origin
2153         https://bugs.webkit.org/show_bug.cgi?id=155405
2154         <rdar://problem/25131007>
2155
2156         Reviewed by Eric Carlson.
2157
2158         When gUM is called from the main frame, or from a subframe with the same origin, the
2159         top level document origin should be the same.
2160
2161         * Modules/mediastream/UserMediaRequest.cpp:
2162         (WebCore::UserMediaRequest::userMediaDocumentOrigin): Reverse the logic so that it is similar
2163         to topLevelDocumentOrigin.
2164         (WebCore::UserMediaRequest::topLevelDocumentOrigin): Return the top origin always.
2165
2166 2016-03-13  David Kilzer  <ddkilzer@apple.com>
2167
2168         REGRESSION (r198079): Windows build broke because of "%PRId64" format specifier
2169
2170         * platform/network/ParsedContentRange.cpp: Add #include
2171         <wtf/StdLibExtras.h> and remove local definition of "PRId64".
2172
2173 2016-03-13  Joonghun Park  <jh718.park@samsung.com>
2174
2175         [EFL] Fix debug build error since r197690. Unreviewed.
2176         https://bugs.webkit.org/show_bug.cgi?id=155408
2177
2178         Unreviewed. Change %lld to %PRId instead to correct the error below.
2179         error: format ‘%lld’ expects argument of type ‘long long int’,
2180         but argument 5 has type ‘std::chrono::duration<long int, std::ratio<1l, 1000l> >::rep
2181         {aka long int}’ [-Werror=format=]
2182
2183         * page/DOMTimer.cpp:
2184         (WebCore::DOMTimer::updateTimerIntervalIfNecessary):
2185
2186 2016-03-12  Myles C. Maxfield  <mmaxfield@apple.com>
2187
2188         [Cocoa] Remove typedef from NSScrollerImp to ScrollbarPainter
2189         https://bugs.webkit.org/show_bug.cgi?id=155379
2190
2191         Reviewed by Beth Dakin.
2192
2193         There's no reason to not call them what they are.
2194
2195         No new tests because there is no behavior change.
2196
2197         * page/scrolling/AsyncScrollingCoordinator.cpp:
2198         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
2199         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
2200         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
2201         (WebCore::ScrollingStateFrameScrollingNode::setScrollerImpsFromScrollbars):
2202         (WebCore::ScrollingStateFrameScrollingNode::setScrollbarPaintersFromScrollbars): Deleted.
2203         * page/scrolling/ScrollingStateFrameScrollingNode.h:
2204         * page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm:
2205         (WebCore::ScrollingStateFrameScrollingNode::setScrollerImpsFromScrollbars):
2206         (WebCore::ScrollingStateFrameScrollingNode::setScrollbarPaintersFromScrollbars): Deleted.
2207         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
2208         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2209         (WebCore::ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac):
2210         (WebCore::ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac):
2211         (WebCore::ScrollingTreeFrameScrollingNodeMac::releaseReferencesToScrollerImpsOnTheMainThread):
2212         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren):
2213         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
2214         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
2215         (WebCore::ScrollingTreeFrameScrollingNodeMac::releaseReferencesToScrollbarPaintersOnTheMainThread): Deleted.
2216         * platform/ScrollbarThemeComposite.h:
2217         * platform/mac/ScrollAnimatorMac.h:
2218         * platform/mac/ScrollAnimatorMac.mm:
2219         (scrollbarPainterForScrollbar):
2220         (-[WebScrollerImpDelegate setUpAlphaAnimation:scrollerPainter:part:animateAlphaTo:duration:]):
2221         (-[WebScrollerImpDelegate scrollerImp:animateKnobAlphaTo:duration:]):
2222         (-[WebScrollerImpDelegate scrollerImp:animateTrackAlphaTo:duration:]):
2223         (-[WebScrollerImpDelegate scrollerImp:animateUIStateTransitionWithDuration:]):
2224         (-[WebScrollerImpDelegate scrollerImp:animateExpansionTransitionWithDuration:]):
2225         (WebCore::ScrollAnimatorMac::ScrollAnimatorMac):
2226         (WebCore::ScrollAnimatorMac::~ScrollAnimatorMac):
2227         (WebCore::ScrollAnimatorMac::mouseEnteredScrollbar):
2228         (WebCore::ScrollAnimatorMac::mouseExitedScrollbar):
2229         (WebCore::ScrollAnimatorMac::mouseIsDownInScrollbar):
2230         (WebCore::ScrollAnimatorMac::didAddVerticalScrollbar):
2231         (WebCore::ScrollAnimatorMac::willRemoveVerticalScrollbar):
2232         (WebCore::ScrollAnimatorMac::didAddHorizontalScrollbar):
2233         (WebCore::ScrollAnimatorMac::willRemoveHorizontalScrollbar):
2234         (WebCore::ScrollAnimatorMac::invalidateScrollbarPartLayers):
2235         (WebCore::ScrollAnimatorMac::verticalScrollbarLayerDidChange):
2236         (WebCore::ScrollAnimatorMac::horizontalScrollbarLayerDidChange):
2237         (WebCore::ScrollAnimatorMac::shouldScrollbarParticipateInHitTesting):
2238         (WebCore::ScrollAnimatorMac::notifyContentAreaScrolled):
2239         (WebCore::ScrollAnimatorMac::cancelAnimations):
2240         (WebCore::ScrollAnimatorMac::updateScrollerStyle):
2241         (WebCore::ScrollAnimatorMac::initialScrollbarPaintTimerFired):
2242         (-[WebScrollbarPainterDelegate setUpAlphaAnimation:scrollerPainter:part:animateAlphaTo:duration:]): Deleted.
2243         (-[WebScrollbarPainterDelegate scrollerImp:animateKnobAlphaTo:duration:]): Deleted.
2244         (-[WebScrollbarPainterDelegate scrollerImp:animateTrackAlphaTo:duration:]): Deleted.
2245         (-[WebScrollbarPainterDelegate scrollerImp:animateUIStateTransitionWithDuration:]): Deleted.
2246         (-[WebScrollbarPainterDelegate scrollerImp:animateExpansionTransitionWithDuration:]): Deleted.
2247         * platform/mac/ScrollbarThemeMac.h:
2248         * platform/mac/ScrollbarThemeMac.mm:
2249         (WebCore::scrollbarMap):
2250         (+[WebScrollbarPrefsObserver appearancePrefsChanged:]):
2251         (WebCore::ScrollbarThemeMac::registerScrollbar):
2252         (WebCore::ScrollbarThemeMac::setNewPainterForScrollbar):
2253         (WebCore::ScrollbarThemeMac::painterForScrollbar):
2254         (WebCore::ScrollbarThemeMac::scrollbarThickness):
2255         (WebCore::ScrollbarThemeMac::updateScrollbarOverlayStyle):
2256         (WebCore::ScrollbarThemeMac::hasThumb):
2257         (WebCore::ScrollbarThemeMac::setPaintCharacteristicsForScrollbar):
2258         (WebCore::scrollbarPainterPaint):
2259
2260 2016-03-12  Dean Jackson  <dino@apple.com>
2261
2262         REGRESSION (r188647): Teamtreehouse website sidebar buttons are not rendered
2263         https://bugs.webkit.org/show_bug.cgi?id=155400
2264         <rdar://problem/24818602>
2265
2266         Reviewed by Anders Carlsson.
2267
2268         When we unprefixed CSS filters we accidentally
2269         stopped SVG elements that use the CSS filter shorthands
2270         from rendering. We still don't actually support
2271         the shorthands in this case, but we should render
2272         the element without the filter.
2273
2274         Tests: css3/filters/filters-on-svg-element.html
2275                css3/filters/filters-on-svg-root.html
2276
2277         * rendering/style/RenderStyle.cpp:
2278         (WebCore::RenderStyle::hasReferenceFilterOnly): Add
2279         this new function that tells us if we have the
2280         style of filter that we can handle in SVG content.
2281         * rendering/style/RenderStyle.h:
2282         * rendering/svg/SVGRenderingContext.cpp:
2283         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
2284         We can mark an element as ready to render if it
2285         has a shorthand filter.
2286
2287 2016-03-12  Myles C. Maxfield  <mmaxfield@apple.com>
2288
2289         Delete dead SVG Font code
2290         https://bugs.webkit.org/show_bug.cgi?id=154718
2291
2292         Reviewed by Antti Koivisto.
2293
2294         All the ports have adopted the SVG -> OTF Font Converter, so there will never
2295         be an instantiation of a font backed by a DOM subtree. We can remove all the
2296         infrastructure used to support that.
2297
2298         No new tests because there is no behavior change.
2299
2300         * CMakeLists.txt:
2301         * Configurations/FeatureDefines.xcconfig:
2302         * WebCore.order:
2303         * WebCore.xcodeproj/project.pbxproj:
2304         * css/CSSFontFaceSource.cpp:
2305         (WebCore::CSSFontFaceSource::CSSFontFaceSource): Deleted.
2306         (WebCore::CSSFontFaceSource::font): Deleted.
2307         * css/CSSFontFaceSource.h:
2308         * loader/cache/CachedFont.cpp:
2309         * loader/cache/CachedSVGFont.cpp:
2310         (WebCore::CachedSVGFont::createFont): Deleted.
2311         (WebCore::CachedSVGFont::ensureCustomFontData): Deleted.
2312         * loader/cache/CachedSVGFont.h:
2313         * platform/graphics/Font.cpp:
2314         (WebCore::Font::Font):
2315         (WebCore::fillGlyphPage):
2316         (WebCore::Font::description): Deleted.
2317         (WebCore::Font::createScaledFont): Deleted.
2318         (WebCore::Font::applyTransforms): Deleted.
2319         * platform/graphics/Font.h:
2320         (WebCore::Font::widthForGlyph):
2321         (WebCore::Font::SVGData::~SVGData): Deleted.
2322         (WebCore::Font::create): Deleted.
2323         (WebCore::Font::svgData): Deleted.
2324         (WebCore::Font::isSVGFont): Deleted.
2325         * platform/graphics/win/FontWin.cpp:
2326         * platform/graphics/FontCascade.cpp:
2327         (WebCore::FontCascade::drawText):
2328         (WebCore::FontCascade::drawEmphasisMarks):
2329         (WebCore::FontCascade::glyphDataForCharacter):
2330         (WebCore::FontCascade::adjustSelectionRectForText):
2331         (WebCore::FontCascade::offsetForPosition):
2332         (WebCore::FontCascade::drawEmphasisMarksForSimpleText):
2333         (WebCore::FontCascade::drawGlyphBuffer):
2334         (WebCore::isDrawnWithSVGFont): Deleted.
2335         (WebCore::FontCascade::width): Deleted.
2336         (WebCore::FontCascade::codePath): Deleted.
2337         * platform/graphics/FontCascade.h:
2338         * platform/graphics/GraphicsContext.h:
2339         * platform/graphics/SVGGlyph.cpp: Removed.
2340         (WebCore::processArabicFormDetection): Deleted.
2341         (WebCore::charactersWithArabicForm): Deleted.
2342         (WebCore::isCompatibleArabicForm): Deleted.
2343         (WebCore::isCompatibleGlyph): Deleted.
2344         * platform/graphics/SVGGlyph.h: Removed.
2345         (WebCore::SVGGlyph::SVGGlyph): Deleted.
2346         (WebCore::SVGGlyph::inheritedValue): Deleted.
2347         (WebCore::SVGGlyph::operator==): Deleted.
2348         * platform/graphics/TextRun.cpp:
2349         * platform/graphics/TextRun.h:
2350         (WebCore::TextRun::RenderingContext::~RenderingContext): Deleted.
2351         (WebCore::TextRun::renderingContext): Deleted.
2352         (WebCore::TextRun::setRenderingContext): Deleted.
2353         * platform/graphics/WidthIterator.cpp:
2354         (WebCore::WidthIterator::applyFontTransforms):
2355         (WebCore::WidthIterator::advanceInternal):
2356         (WebCore::WidthIterator::glyphDataForCharacter): Deleted.
2357         * platform/graphics/WidthIterator.h:
2358         (WebCore::WidthIterator::lastGlyphName): Deleted.
2359         (WebCore::WidthIterator::setLastGlyphName): Deleted.
2360         (WebCore::WidthIterator::arabicForms): Deleted.
2361         * platform/graphics/cairo/FontCairo.cpp:
2362         (WebCore::CairoGlyphToPathTranslator::advance):
2363         (WebCore::FontCascade::dashesForIntersectionsWithRect):
2364         (WebCore::CairoGlyphToPathTranslator::moveToNextValidGlyph): Deleted.
2365         * platform/graphics/cocoa/FontCascadeCocoa.mm:
2366         (WebCore::MacGlyphToPathTranslator::advance):
2367         (WebCore::FontCascade::dashesForIntersectionsWithRect):
2368         (WebCore::FontCascade::primaryFontIsSystemFont):
2369         (WebCore::FontCascade::drawEmphasisMarksForComplexText):
2370         (WebCore::MacGlyphToPathTranslator::moveToNextValidGlyph): Deleted.
2371         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
2372         (WebCore::HarfBuzzShaper::shapeHarfBuzzRuns): Deleted.
2373         * platform/graphics/mac/ComplexTextController.cpp:
2374         (WebCore::TextLayout::isNeeded):
2375         (WebCore::TextLayout::TextLayout):
2376         (WebCore::TextLayout::constructTextRun):
2377         * rendering/EllipsisBox.cpp:
2378         (WebCore::EllipsisBox::paint):
2379         (WebCore::EllipsisBox::selectionRect):
2380         (WebCore::EllipsisBox::paintSelection):
2381         * rendering/InlineTextBox.cpp:
2382         (WebCore::InlineTextBox::localSelectionRect):
2383         (WebCore::InlineTextBox::paint):
2384         (WebCore::InlineTextBox::paintSelection):
2385         (WebCore::InlineTextBox::paintCompositionBackground):
2386         (WebCore::InlineTextBox::paintDocumentMarker):
2387         (WebCore::InlineTextBox::paintTextMatchMarker):
2388         (WebCore::InlineTextBox::offsetForPosition):
2389         (WebCore::InlineTextBox::positionForOffset):
2390         (WebCore::InlineTextBox::constructTextRun):
2391         * rendering/InlineTextBox.h:
2392         * rendering/RenderBlock.cpp:
2393         (WebCore::RenderBlock::constructTextRun):
2394         * rendering/RenderBlock.h:
2395         * rendering/RenderBlockFlow.cpp:
2396         (WebCore::stripTrailingSpace):
2397         * rendering/RenderBlockLineLayout.cpp:
2398         (WebCore::RenderBlockFlow::checkLinesForTextOverflow):
2399         * rendering/RenderDeprecatedFlexibleBox.cpp:
2400         (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
2401         * rendering/RenderFileUploadControl.cpp:
2402         (WebCore::RenderFileUploadControl::paintObject):
2403         (WebCore::RenderFileUploadControl::computeIntrinsicLogicalWidths):
2404         * rendering/RenderImage.cpp:
2405         (WebCore::RenderImage::setImageSizeForAltText):
2406         (WebCore::RenderImage::paintReplaced):
2407         * rendering/RenderListBox.cpp:
2408         (WebCore::RenderListBox::updateFromElement):
2409         * rendering/RenderListMarker.cpp:
2410         (WebCore::RenderListMarker::paint):
2411         (WebCore::RenderListMarker::computePreferredLogicalWidths):
2412         (WebCore::RenderListMarker::getRelativeMarkerRect):
2413         * rendering/RenderMenuList.cpp:
2414         (RenderMenuList::updateOptionsWidth):
2415         * rendering/RenderText.cpp:
2416         (WebCore::RenderText::widthFromCache):
2417         (WebCore::RenderText::trimmedPrefWidths):
2418         (WebCore::hyphenWidth):
2419         (WebCore::maxWordFragmentWidth):
2420         (WebCore::RenderText::computePreferredLogicalWidths):
2421         (WebCore::RenderText::width):
2422         * rendering/RenderTextControl.cpp:
2423         (WebCore::RenderTextControl::getAverageCharWidth):
2424         * rendering/RenderThemeIOS.mm:
2425         (WebCore::RenderThemeMeasureTextClient::RenderThemeMeasureTextClient):
2426         (WebCore::adjustInputElementButtonStyle):
2427         * rendering/SimpleLineLayout.cpp:
2428         (WebCore::SimpleLineLayout::canUseForFontAndText): Deleted.
2429         * rendering/line/BreakingContext.h:
2430         (WebCore::WordTrailingSpace::WordTrailingSpace):
2431         (WebCore::WordTrailingSpace::width):
2432         (WebCore::measureHyphenWidth):
2433         (WebCore::textWidth):
2434         (WebCore::tryHyphenating):
2435         (WebCore::BreakingContext::handleText):
2436         * rendering/svg/RenderSVGAllInOne.cpp:
2437         * rendering/svg/RenderSVGText.cpp:
2438         * rendering/svg/SVGInlineTextBox.cpp:
2439         (WebCore::SVGInlineTextBox::prepareGraphicsContextForTextPainting):
2440         (WebCore::SVGInlineTextBox::restoreGraphicsContextAfterTextPainting):
2441         (WebCore::SVGInlineTextBox::paintTextWithShadows):
2442         (WebCore::SVGInlineTextBox::constructTextRun): Deleted.
2443         * rendering/svg/SVGInlineTextBox.h:
2444         * rendering/svg/SVGTextLayoutEngine.cpp:
2445         (WebCore::SVGTextLayoutEngine::layoutTextOnLineOrPath):
2446         * rendering/svg/SVGTextLayoutEngineSpacing.cpp:
2447         (WebCore::SVGTextLayoutEngineSpacing::calculateSVGKerning): Deleted.
2448         * rendering/svg/SVGTextLayoutEngineSpacing.h:
2449         * rendering/svg/SVGTextMetrics.cpp:
2450         (WebCore::SVGTextMetrics::SVGTextMetrics):
2451         (WebCore::SVGTextMetrics::constructTextRun): Deleted.
2452         * rendering/svg/SVGTextMetrics.h:
2453         * rendering/svg/SVGTextMetricsBuilder.cpp:
2454         (WebCore::SVGTextMetricsBuilder::advanceSimpleText):
2455         * rendering/svg/SVGTextRunRenderingContext.cpp: Removed.
2456         (WebCore::svgFontAndFontFaceElementForFontData): Deleted.
2457         (WebCore::SVGTextRunRenderingContext::floatWidthUsingSVGFont): Deleted.
2458         (WebCore::SVGTextRunRenderingContext::applySVGKerning): Deleted.
2459         (WebCore::SVGGlyphToPathTranslator::SVGGlyphToPathTranslator): Deleted.
2460         (WebCore::SVGGlyphToPathTranslator::transform): Deleted.
2461         (WebCore::SVGGlyphToPathTranslator::path): Deleted.
2462         (WebCore::SVGGlyphToPathTranslator::extents): Deleted.
2463         (WebCore::SVGGlyphToPathTranslator::moveToNextValidGlyph): Deleted.
2464         (WebCore::SVGGlyphToPathTranslator::advance): Deleted.
2465         (WebCore::SVGTextRunRenderingContext::createGlyphToPathTranslator): Deleted.
2466         (WebCore::SVGTextRunRenderingContext::drawSVGGlyphs): Deleted.
2467         (WebCore::missingGlyphForFont): Deleted.
2468         (WebCore::SVGTextRunRenderingContext::glyphDataForCharacter): Deleted.
2469         * rendering/svg/SVGTextRunRenderingContext.h: Removed.
2470         * svg/SVGAllInOne.cpp:
2471         * svg/SVGFontData.cpp: Removed.
2472         (WebCore::SVGFontData::SVGFontData): Deleted.
2473         (WebCore::SVGFontData::initializeFont): Deleted.
2474         (WebCore::SVGFontData::widthForSVGGlyph): Deleted.
2475         (WebCore::SVGFontData::applySVGGlyphSelection): Deleted.
2476         (WebCore::SVGFontData::fillSVGGlyphPage): Deleted.
2477         (WebCore::SVGFontData::fillBMPGlyphs): Deleted.
2478         (WebCore::SVGFontData::fillNonBMPGlyphs): Deleted.
2479         (WebCore::computeNormalizedSpaces): Deleted.
2480         (WebCore::createStringWithMirroredCharacters): Deleted.
2481         * svg/SVGFontData.h: Removed.
2482         (WebCore::SVGFontData::~SVGFontData): Deleted.
2483         (WebCore::SVGFontData::svgFontFaceElement): Deleted.
2484         (WebCore::SVGFontData::horizontalOriginX): Deleted.
2485         (WebCore::SVGFontData::horizontalOriginY): Deleted.
2486         (WebCore::SVGFontData::horizontalAdvanceX): Deleted.
2487         (WebCore::SVGFontData::verticalOriginX): Deleted.
2488         (WebCore::SVGFontData::verticalOriginY): Deleted.
2489         (WebCore::SVGFontData::verticalAdvanceY): Deleted.
2490         * svg/SVGFontElement.cpp:
2491         (WebCore::SVGFontElement::SVGFontElement): Deleted.
2492         (WebCore::SVGFontElement::invalidateGlyphCache): Deleted.
2493         (WebCore::SVGFontElement::firstMissingGlyphElement): Deleted.
2494         (WebCore::SVGFontElement::registerLigaturesInGlyphCache): Deleted.
2495         (WebCore::SVGFontElement::ensureGlyphCache): Deleted.
2496         (WebCore::SVGKerningMap::clear): Deleted.
2497         (WebCore::SVGKerningMap::insert): Deleted.
2498         (WebCore::stringMatchesUnicodeRange): Deleted.
2499         (WebCore::stringMatchesGlyphName): Deleted.
2500         (WebCore::stringMatchesUnicodeName): Deleted.
2501         (WebCore::matches): Deleted.
2502         (WebCore::kerningForPairOfStringsAndGlyphs): Deleted.
2503         (WebCore::SVGFontElement::horizontalKerningForPairOfStringsAndGlyphs): Deleted.
2504         (WebCore::SVGFontElement::verticalKerningForPairOfStringsAndGlyphs): Deleted.
2505         (WebCore::SVGFontElement::collectGlyphsForString): Deleted.
2506         (WebCore::SVGFontElement::collectGlyphsForGlyphName): Deleted.
2507         (WebCore::SVGFontElement::svgGlyphForGlyph): Deleted.
2508         (WebCore::SVGFontElement::missingGlyph): Deleted.
2509         * svg/SVGFontElement.h:
2510         (WebCore::SVGKerning::SVGKerning): Deleted.
2511         (WebCore::SVGKerningMap::isEmpty): Deleted.
2512         * svg/SVGGlyphElement.cpp:
2513         (WebCore::SVGGlyphElement::invalidateGlyphCache): Deleted.
2514         (WebCore::SVGGlyphElement::parseAttribute): Deleted.
2515         (WebCore::SVGGlyphElement::insertedInto): Deleted.
2516         (WebCore::SVGGlyphElement::removedFrom): Deleted.
2517         (WebCore::parseArabicForm): Deleted.
2518         (WebCore::parseOrientation): Deleted.
2519         (WebCore::SVGGlyphElement::inheritUnspecifiedAttributes): Deleted.
2520         (WebCore::parseSVGGlyphAttribute): Deleted.
2521         (WebCore::SVGGlyphElement::buildGenericGlyphIdentifier): Deleted.
2522         (WebCore::SVGGlyphElement::buildGlyphIdentifier): Deleted.
2523         * svg/SVGGlyphElement.h:
2524         * svg/SVGGlyphMap.h: Removed.
2525         (WebCore::GlyphMapNode::GlyphMapNode): Deleted.
2526         (WebCore::GlyphMapNode::create): Deleted.
2527         (WebCore::SVGGlyphMap::SVGGlyphMap): Deleted.
2528         (WebCore::SVGGlyphMap::addGlyph): Deleted.
2529         (WebCore::SVGGlyphMap::appendToGlyphTable): Deleted.
2530         (WebCore::SVGGlyphMap::compareGlyphPriority): Deleted.
2531         (WebCore::SVGGlyphMap::collectGlyphsForString): Deleted.
2532         (WebCore::SVGGlyphMap::clear): Deleted.
2533         (WebCore::SVGGlyphMap::svgGlyphForGlyph): Deleted.
2534         (WebCore::SVGGlyphMap::glyphIdentifierForGlyphName): Deleted.
2535         * svg/SVGHKernElement.cpp:
2536         (WebCore::SVGHKernElement::insertedInto): Deleted.
2537         (WebCore::SVGHKernElement::removedFrom): Deleted.
2538         * svg/SVGHKernElement.h:
2539         * svg/SVGToOTFFontConversion.cpp:
2540         * svg/SVGToOTFFontConversion.h:
2541         * svg/SVGVKernElement.cpp:
2542         (WebCore::SVGVKernElement::insertedInto): Deleted.
2543         (WebCore::SVGVKernElement::removedFrom): Deleted.
2544         * svg/SVGVKernElement.h:
2545
2546 2016-03-12  Myles C. Maxfield  <mmaxfield@apple.com>
2547
2548         [OS X] Scrollbars of overflow:scroll divs should appear on the left on RTL systems
2549         https://bugs.webkit.org/show_bug.cgi?id=155385
2550
2551         Reviewed by Simon Fraser.
2552
2553         There is already some existing setup for RTL scrollbars. This patch hooks up this
2554         existing support to the OS X triggering mechanism introduced in r197956. It also
2555         fixes up the existing support to function even when the direction of the
2556         RTL-scrollbar div is LTR (this means the contents of the div must be pushed
2557         over by the width of the scrollbar).
2558
2559         Tests: fast/scrolling/rtl-scrollbars-overflow-contents.html
2560                fast/scrolling/rtl-scrollbars-overflow-dir-rtl.html
2561                fast/scrolling/rtl-scrollbars-overflow-padding.html
2562                fast/scrolling/rtl-scrollbars-overflow-simple.html
2563                fast/scrolling/rtl-scrollbars-overflow.html
2564
2565         * rendering/RenderBlock.cpp:
2566         (WebCore::RenderBlock::addOverflowFromPositionedObjects):
2567         (WebCore::RenderBlock::logicalLeftOffsetForContent):
2568         (WebCore::RenderBlock::logicalRightOffsetForContent):
2569         * rendering/RenderBlockFlow.cpp:
2570         (WebCore::RenderBlockFlow::determineLogicalLeftPositionForChild):
2571         * rendering/RenderBox.cpp:
2572         (WebCore::RenderBox::overflowClipRect):
2573         (WebCore::RenderBox::layoutOverflowRectForPropagation):
2574         * rendering/RenderLayer.cpp:
2575         (WebCore::RenderLayer::computeScrollDimensions):
2576         * rendering/style/RenderStyle.cpp:
2577         (WebCore::RenderStyle::shouldPlaceBlockDirectionScrollbarOnLogicalLeft):
2578         * rendering/style/RenderStyle.h:
2579
2580 2016-03-12  Zalan Bujtas  <zalan@apple.com>
2581
2582         [Forms: focus] focus rings around text fields do not follow contour (border-radius)
2583         https://bugs.webkit.org/show_bug.cgi?id=154099
2584         rdar://problem/9988429
2585
2586         Reviewed by Tim Horton.
2587
2588         This patch enables outline-style: auto to follow the curve of border-radius.
2589         When both border-radius and outline-style: auto are set, the native focusring painting will take the border-radius values
2590         into account. This is only for outline-style: auto, other non-auto outline styles paint as if there
2591         was no border-radius set.
2592         It supports both single and multiline content with joint rectangles.
2593         However in case of disjoint rectangles, we fallback to the non-radius drawing.
2594
2595         Tests: fast/inline/hidpi-outline-auto-with-border-radius-horizontal-ltr.html
2596                fast/inline/hidpi-outline-auto-with-border-radius-horizontal-rtl.html
2597                fast/inline/hidpi-outline-auto-with-border-radius-vertical-ltr.html
2598                fast/inline/hidpi-outline-auto-with-border-radius-vertical-rtl.html
2599
2600         * platform/graphics/GraphicsContext.h:
2601         * platform/graphics/Path.cpp:
2602         (WebCore::Path::addBeziersForRoundedRect):
2603         * platform/graphics/Path.h:
2604         (WebCore::Path::circleControlPoint):
2605         * platform/graphics/PathUtilities.cpp:
2606         (WebCore::polygonsForRect):
2607         (WebCore::PathUtilities::pathsWithShrinkWrappedRects):
2608         (WebCore::startAndEndPointsForCorner):
2609         (WebCore::cornerType):
2610         (WebCore::controlPointsForBezierCurve):
2611         (WebCore::adjustedtRadiiForHuggingCurve):
2612         (WebCore::PathUtilities::pathWithShrinkWrappedRectsForOutline):
2613         * platform/graphics/PathUtilities.h:
2614         * platform/graphics/mac/GraphicsContextMac.mm:
2615         (WebCore::GraphicsContext::drawFocusRing):
2616         * rendering/RenderElement.cpp:
2617         (WebCore::RenderElement::paintFocusRing):
2618
2619 2016-03-11  Ryosuke Niwa  <rniwa@webkit.org>
2620
2621         Add Event.deepPath() and Event.scoped
2622         https://bugs.webkit.org/show_bug.cgi?id=153538
2623         <rdar://problem/24363836>
2624
2625         Reviewed by Darin Adler.
2626
2627         Added the support for deepPath(), scoped, and relatedTargetScoped on Event.prototype for shadow DOM:
2628         http://w3c.github.io/webcomponents/spec/shadow/#extensions-to-event-interface
2629         and updated the EventPath class to respect scoped and relatedTargetScoped flags as specified at:
2630         http://w3c.github.io/webcomponents/spec/shadow/#get-the-parent
2631
2632         Tests: fast/shadow-dom/Extensions-to-Event-Interface.html
2633                fast/shadow-dom/trusted-event-scoped-flags.html
2634
2635         * bindings/scripts/CodeGeneratorJS.pm:
2636         (GenerateConstructorDefinition): Added the support for Conditional for InitializedByEventConstructor.
2637         * bindings/scripts/test/GObject/WebKitDOMTestEventConstructor.cpp:
2638         * bindings/scripts/test/GObject/WebKitDOMTestEventConstructor.h:
2639         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2640         * bindings/scripts/test/ObjC/DOMTestEventConstructor.h:
2641         * bindings/scripts/test/ObjC/DOMTestEventConstructor.mm:
2642         * bindings/scripts/test/TestEventConstructor.idl: Added a test case for using InitializedByEventConstructor
2643         with Conditional.
2644         * dom/Event.cpp:
2645         (WebCore::Event::Event): Initialize m_scoped and m_relatedTargetScoped from EventInit dictionary.
2646         (WebCore::Event::scoped): Added. Implements http://w3c.github.io/webcomponents/spec/shadow/#scoped-flag
2647         (WebCore::Event::deepPath): Added.
2648         * dom/Event.h:
2649         (WebCore::Event::relatedTargetScoped): Added. Overridden by FocusEvent and MouseEvent to implement
2650         http://w3c.github.io/webcomponents/spec/shadow/#relatedtargetscoped-flag
2651         (WebCore::Event::setEventPath): Added.
2652         (WebCore::Event::clearEventPath): Added.
2653         * dom/Event.idl: Added scoped, relatedTargetScoped, and deepPath() conditionally enabled for shadow DOM.
2654         * dom/EventContext.h:
2655         (WebCore::EventContext::currentTarget):
2656         * dom/EventDispatcher.cpp:
2657         (WebCore::EventDispatcher::dispatchEvent): Set the event path while the event is being dispatched.
2658         * dom/EventPath.cpp:
2659         (WebCore::shouldEventCrossShadowBoundary): Check event.scoped flag instead of hard-coding a list of events here
2660         which has been moved to Event::scoped. See above.
2661         (WebCore::EventPath::setRelatedTarget): Check m_event.relatedTargetScoped() instead of hard-coding a list of
2662         events here. relatedTargetScoped is overridden by FocusEvent and MouseEvent.
2663         (WebCore::EventPath::hasEventListeners): Fixed the misleading variable name.
2664         (WebCore::isUnclosedNodeOf): Added. Implements http://w3c.github.io/webcomponents/spec/shadow/#dfn-unclosed-node
2665         (WebCore::EventPath::computePathDisclosedToTarget): Added. Implements the algorithm to filter event targets:
2666         http://w3c.github.io/webcomponents/spec/shadow/#widl-Event-deepPath-sequence-EventTarget
2667         * dom/EventPath.h:
2668         * dom/FocusEvent.cpp:
2669         (WebCore::FocusEvent::relatedTargetScoped): Returns true when this is a trusted event per:
2670         http://w3c.github.io/webcomponents/spec/shadow/#relatedtargetscoped-flag
2671         * dom/FocusEvent.h:
2672         * dom/MouseEvent.cpp:
2673         (WebCore::MouseEvent::relatedTargetScoped): Ditto.
2674         * dom/MouseEvent.h:
2675
2676 2016-03-11  John Wilander  <wilander@apple.com>
2677
2678         Move prevalent resource classifier from WebCore to WebKit.
2679         https://bugs.webkit.org/show_bug.cgi?id=155242
2680         <rdar://problem/24913272>
2681
2682         Reviewed by Andy Estes.
2683
2684         No new tests since we have yet to decide how to set up tests for prevalent resources.
2685
2686         * loader/ResourceLoadObserver.cpp:
2687         (WebCore::ResourceLoadObserver::logFrameNavigation):
2688         (WebCore::ResourceLoadObserver::logSubresourceLoading):
2689             - Removed calls to old classifier in WebCore.
2690         * loader/ResourceLoadStatistics.cpp:
2691         (WebCore::encodeHashCountedSet):
2692         (WebCore::ResourceLoadStatistics::checkAndSetAsPrevalentResourceIfNecessary): Deleted.
2693         (WebCore::ResourceLoadStatistics::hasPrevalentResourceCharacteristics): Deleted.
2694         * loader/ResourceLoadStatistics.h:
2695             - Deleted old classification functions.
2696         * loader/ResourceLoadStatisticsStore.cpp:
2697         (WebCore::ResourceLoadStatisticsStore::create):
2698         (WebCore::ResourceLoadStatisticsStore::fireDataModificationHandler):
2699         (WebCore::ResourceLoadStatisticsStore::hasEnoughDataForStatisticsProcessing):
2700             - New function to allow for checks before calls to processStatistics.
2701         (WebCore::ResourceLoadStatisticsStore::processStatistics):
2702             - New function that receives a lamda and executes it on every entry in its statistics map.
2703         * loader/ResourceLoadStatisticsStore.h:
2704
2705 2016-03-11  Jiewen Tan  <jiewen_tan@apple.com>
2706
2707         WebKit should not be redirected to an invalid URL
2708         https://bugs.webkit.org/show_bug.cgi?id=155263
2709         <rdar://problem/22820172>
2710
2711         Reviewed by Brent Fulgham.
2712
2713         Test: http/tests/navigation/redirect-to-invalid-url.html
2714
2715         * loader/SubresourceLoader.cpp:
2716         (WebCore::SubresourceLoader::willSendRequestInternal):
2717
2718 2016-03-10  Maksim Kisilev <mkisilev@yandex-team.ru>
2719
2720         Fix typo in StyleTreeResolver.cpp
2721         https://bugs.webkit.org/show_bug.cgi?id=139946
2722
2723         Reviewed by Andy Estes.
2724
2725         The constructor for CheckForVisibilityChangeOnRecalcStyle was improperly comparing the
2726         result of WKContentChange() (which is not a function) to WKContentVisibilityChange. I
2727         believe the above cast would implicitly resolve to WKContentNoChange in all cases,
2728         whether a visibility change had been observed or not.
2729         
2730         This patch corrects this problem. I would expect that this might affect some content
2731         visibility change behavior, but I'm not sure what the appropriate test case would be
2732         since this was apparently found through code inspection.
2733
2734         * style/StyleTreeResolver.cpp:
2735         (WebCore::Style::CheckForVisibilityChangeOnRecalcStyle::CheckForVisibilityChangeOnRecalcStyle):
2736
2737 2016-03-11  Chris Dumez  <cdumez@apple.com>
2738
2739         iOS-sim debug: WebCoreNSURLSessionTest.BasicOperation and WebCoreNSURLSessionTest.InvalidateEmpty asserting
2740         https://bugs.webkit.org/show_bug.cgi?id=155256
2741
2742         Reviewed by Alexey Proskuryakov.
2743
2744         r197628 consolidated the runtime application checking code for iOS and
2745         Mac. However, while the new code works fine for WebKit2, it is unsafe
2746         on WebKit1 / iOS and hits assertion in debug. The reason is that
2747         applicationBundleIdentifier() for getting called from several threads
2748         (WebThread, UIThread).
2749
2750         To address the problem, this patch renames applicationBundleIdentifier()
2751         to applicationBundleIdentifierOverride() and only initializes the
2752         override upon WebProcess and Network process initialization. We therefore
2753         do not initialize the override in WebKit1 or in the WebKit2 UIProcess.
2754         When the override is not set, we fall back to using the main bundle
2755         identifier (which does the right thing for WebKit1 / WebKit2 UIProcess)
2756         but without caching it to avoid thread safety issues.
2757
2758         No new tests, already covered by API tests currently crashing.
2759
2760         * platform/RuntimeApplicationChecks.mm:
2761         (WebCore::applicationBundleIdentifierOverride):
2762         - Renamed applicationBundleIdentifier() to applicationBundleIdentifierOverride()
2763           and only initialize upon initialization of the WebProcess or the Network
2764           process.
2765         - In debug, set a flag to indicate that the override was already queried.
2766
2767         (WebCore::applicationBundleIdentifier):
2768         New utility function that is returns the application bundle override if it is
2769         set and fallback to calling [[NSBundle mainBundle] bundleIdentifier] otherwise.
2770
2771         (WebCore::setApplicationBundleIdentifier):
2772         Add assertions to make sure that:
2773         1. This is always called from the main thread.
2774         2. The application bundle identifier has not been queried *before* getting
2775            overriden as this would indicate a bug in our code and we would have wrongly
2776            returned the main bundle identifier in such case.
2777
2778         (WebCore::MacApplication::isAppleMail):
2779         (WebCore::MacApplication::isIBooks):
2780         (WebCore::MacApplication::isITunes):
2781         (WebCore::MacApplication::isMicrosoftMessenger):
2782         (WebCore::MacApplication::isAdobeInstaller):
2783         (WebCore::MacApplication::isMicrosoftOutlook):
2784         (WebCore::MacApplication::isQuickenEssentials):
2785         (WebCore::MacApplication::isAperture):
2786         (WebCore::MacApplication::isVersions):
2787         (WebCore::MacApplication::isHRBlock):
2788         (WebCore::MacApplication::isHipChat):
2789         (WebCore::IOSApplication::isMobileSafari):
2790         (WebCore::IOSApplication::isDumpRenderTree):
2791         (WebCore::IOSApplication::isMobileStore):
2792         (WebCore::IOSApplication::isFacebook):
2793         (WebCore::IOSApplication::isDaijisenDictionary):
2794         (WebCore::IOSApplication::isNASAHD):
2795         (WebCore::IOSApplication::isTheEconomistOnIphone):
2796         (WebCore::IOSApplication::isWebProcess):
2797         (WebCore::IOSApplication::isIBooks):
2798         Drop assertions making sure the cached flag is correct. We now have
2799         an assertion to detect this earlier in setApplicationBundleIdentifier().
2800
2801 2016-03-10  Jer Noble  <jer.noble@apple.com>
2802
2803         Web Audio becomes distorted after sample rate changes
2804         https://bugs.webkit.org/show_bug.cgi?id=154538
2805         <rdar://problem/24771292>
2806
2807         Reviewed by Darin Adler.
2808
2809         When the underlying audio hardware sample rate changes, the AudioUnit render callback will begin asking
2810         for fewer or more frames. For example, when the sample rate goes from 44.1kHz to 48kHz, it will ask for
2811         118 samples instead of 128. (And vice-versa, 140 samples instead of 128.) But the Web Audio engine can only
2812         really handle requests in multiples of 128 samples. In the case where there are requests for < 128 samples,
2813         actually render 128, but save off the unrequested samples in a separate bus. Then fill that bus during the
2814         next request.
2815
2816         * platform/audio/AudioBus.cpp:
2817         (WebCore::AudioBus::copyFromRange): Added utility method.
2818         * platform/audio/AudioBus.h:
2819         * platform/audio/ios/AudioDestinationIOS.cpp:
2820         (WebCore::AudioDestinationIOS::AudioDestinationIOS): Create a "spare" bus.
2821         (WebCore::assignAudioBuffersToBus): Moved from inside render.
2822         (WebCore::AudioDestinationIOS::render): Save off extra samples to the "spare" bus.
2823         * platform/audio/ios/AudioDestinationIOS.h:
2824
2825 2016-03-11  Yusuke Suzuki  <utatane.tea@gmail.com>
2826
2827         Unreviewed build fix after r198023.
2828         https://bugs.webkit.org/show_bug.cgi?id=155024
2829
2830         Reviewed by Geoffrey Garen.
2831
2832         Update binding test results.
2833
2834         * bindings/scripts/test/JS/JSTestObj.cpp:
2835         (WebCore::setJSTestObjWithScriptExecutionContextAttribute):
2836         (WebCore::setJSTestObjWithScriptExecutionContextAttributeRaises):
2837         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute):
2838         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
2839         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
2840
2841 2016-03-11  Ryan Haddad  <ryanhaddad@apple.com>
2842
2843         Unreviewed, rolling out r197984.
2844
2845         This change caused an existing LayoutTest to fail
2846
2847         Reverted changeset:
2848
2849         "WebKit should not be redirected to an invalid URL"
2850         https://bugs.webkit.org/show_bug.cgi?id=155263
2851         http://trac.webkit.org/changeset/197984
2852
2853 2016-03-11  Yusuke Suzuki  <utatane.tea@gmail.com>
2854
2855         [ES6] Implement Reflect.set without receiver support
2856         https://bugs.webkit.org/show_bug.cgi?id=155024
2857
2858         Reviewed by Geoffrey Garen.
2859
2860         CustomSetter returns boolean value that indicates the result of [[Set]].
2861         According to this change, this patch modifies the CodeGeneratorJS and test results.
2862
2863         Currently, DOM elements' [[Set]] return true when the setter is found.
2864         This is good for the first step.
2865
2866         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
2867         (WebCore::JSCSSStyleDeclaration::putDelegate):
2868         * bindings/js/JSDOMBinding.cpp:
2869         (WebCore::throwSetterTypeError):
2870         * bindings/js/JSDOMBinding.h:
2871         * bindings/js/JSDOMStringMapCustom.cpp:
2872         (WebCore::JSDOMStringMap::putDelegate):
2873         * bindings/js/JSDOMWindowBase.cpp:
2874         (WebCore::JSDOMWindowBase::updateDocument):
2875         * bindings/js/JSDOMWindowCustom.cpp:
2876         (WebCore::JSDOMWindow::put):
2877         (WebCore::JSDOMWindow::putByIndex):
2878         * bindings/js/JSHTMLAppletElementCustom.cpp:
2879         (WebCore::JSHTMLAppletElement::putDelegate):
2880         * bindings/js/JSHTMLEmbedElementCustom.cpp:
2881         (WebCore::JSHTMLEmbedElement::putDelegate):
2882         * bindings/js/JSHTMLObjectElementCustom.cpp:
2883         (WebCore::JSHTMLObjectElement::putDelegate):
2884         * bindings/js/JSLocationCustom.cpp:
2885         (WebCore::JSLocation::putDelegate):
2886         (WebCore::JSLocationPrototype::putDelegate):
2887         * bindings/js/JSPluginElementFunctions.cpp:
2888         (WebCore::pluginElementCustomPut):
2889         * bindings/js/JSPluginElementFunctions.h:
2890         * bindings/js/JSStorageCustom.cpp:
2891         (WebCore::JSStorage::putDelegate):
2892         * bindings/scripts/CodeGeneratorJS.pm:
2893         (GenerateHeader):
2894         (GenerateImplementation):
2895         (GeneratePrototypeDeclaration):
2896         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2897         (WebCore::setJSTestActiveDOMObjectConstructor):
2898         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
2899         (WebCore::setJSTestClassWithJSBuiltinConstructorConstructor):
2900         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
2901         (WebCore::setJSTestCustomConstructorWithNoInterfaceObjectConstructor):
2902         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
2903         (WebCore::setJSTestCustomNamedGetterConstructor):
2904         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2905         (WebCore::setJSTestEventConstructorConstructor):
2906         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2907         (WebCore::setJSTestEventTargetConstructor):
2908         * bindings/scripts/test/JS/JSTestException.cpp:
2909         (WebCore::setJSTestExceptionConstructor):
2910         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2911         (WebCore::setJSTestGenerateIsReachableConstructor):
2912         * bindings/scripts/test/JS/JSTestInterface.cpp:
2913         (WebCore::setJSTestInterfaceConstructor):
2914         (WebCore::JSTestInterface::put):
2915         (WebCore::JSTestInterface::putByIndex):
2916         (WebCore::setJSTestInterfaceConstructorImplementsStaticAttr):
2917         (WebCore::setJSTestInterfaceImplementsStr2):
2918         (WebCore::setJSTestInterfaceImplementsStr3):
2919         (WebCore::setJSTestInterfaceImplementsNode):
2920         (WebCore::setJSTestInterfaceConstructorSupplementalStaticAttr):
2921         (WebCore::setJSTestInterfaceSupplementalStr2):
2922         (WebCore::setJSTestInterfaceSupplementalStr3):
2923         (WebCore::setJSTestInterfaceSupplementalNode):
2924         * bindings/scripts/test/JS/JSTestInterface.h:
2925         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
2926         (WebCore::setJSTestJSBuiltinConstructorConstructor):
2927         (WebCore::setJSTestJSBuiltinConstructorTestAttributeRWCustom):
2928         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2929         (WebCore::setJSTestMediaQueryListListenerConstructor):
2930         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2931         (WebCore::setJSTestNamedConstructorConstructor):
2932         * bindings/scripts/test/JS/JSTestNode.cpp:
2933         (WebCore::setJSTestNodeConstructor):
2934         (WebCore::setJSTestNodeName):
2935         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
2936         (WebCore::setJSTestNondeterministicConstructor):
2937         (WebCore::setJSTestNondeterministicNondeterministicWriteableAttr):
2938         (WebCore::setJSTestNondeterministicNondeterministicExceptionAttr):
2939         (WebCore::setJSTestNondeterministicNondeterministicGetterExceptionAttr):
2940         (WebCore::setJSTestNondeterministicNondeterministicSetterExceptionAttr):
2941         * bindings/scripts/test/JS/JSTestObj.cpp:
2942         (WebCore::setJSTestObjConstructor):
2943         (WebCore::setJSTestObjConstructorStaticStringAttr):
2944         (WebCore::setJSTestObjTestSubObjEnabledBySettingConstructor):
2945         (WebCore::setJSTestObjEnumAttr):
2946         (WebCore::setJSTestObjByteAttr):
2947         (WebCore::setJSTestObjOctetAttr):
2948         (WebCore::setJSTestObjShortAttr):
2949         (WebCore::setJSTestObjUnsignedShortAttr):
2950         (WebCore::setJSTestObjLongAttr):
2951         (WebCore::setJSTestObjLongLongAttr):
2952         (WebCore::setJSTestObjUnsignedLongLongAttr):
2953         (WebCore::setJSTestObjStringAttr):
2954         (WebCore::setJSTestObjTestObjAttr):
2955         (WebCore::setJSTestObjLenientTestObjAttr):
2956         (WebCore::setJSTestObjStringAttrTreatingNullAsEmptyString):
2957         (WebCore::setJSTestObjXMLObjAttr):
2958         (WebCore::setJSTestObjCreate):
2959         (WebCore::setJSTestObjReflectedStringAttr):
2960         (WebCore::setJSTestObjReflectedIntegralAttr):
2961         (WebCore::setJSTestObjReflectedUnsignedIntegralAttr):
2962         (WebCore::setJSTestObjReflectedBooleanAttr):
2963         (WebCore::setJSTestObjReflectedURLAttr):
2964         (WebCore::setJSTestObjReflectedCustomIntegralAttr):
2965         (WebCore::setJSTestObjReflectedCustomBooleanAttr):
2966         (WebCore::setJSTestObjReflectedCustomURLAttr):
2967         (WebCore::setJSTestObjTypedArrayAttr):
2968         (WebCore::setJSTestObjAttrWithGetterException):
2969         (WebCore::setJSTestObjAttrWithGetterExceptionWithMessage):
2970         (WebCore::setJSTestObjAttrWithSetterException):
2971         (WebCore::setJSTestObjAttrWithSetterExceptionWithMessage):
2972         (WebCore::setJSTestObjStringAttrWithGetterException):
2973         (WebCore::setJSTestObjStringAttrWithSetterException):
2974         (WebCore::setJSTestObjStrictTypeCheckingAttribute):
2975         (WebCore::setJSTestObjCustomAttr):
2976         (WebCore::setJSTestObjOnfoo):
2977         (WebCore::setJSTestObjWithScriptStateAttribute):
2978         (WebCore::setJSTestObjWithCallWithAndSetterCallWithAttribute):
2979         (WebCore::setJSTestObjWithScriptExecutionContextAttribute):
2980         (WebCore::setJSTestObjWithScriptStateAttributeRaises):
2981         (WebCore::setJSTestObjWithScriptExecutionContextAttributeRaises):
2982         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute):
2983         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
2984         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
2985         (WebCore::setJSTestObjWithScriptArgumentsAndCallStackAttribute):
2986         (WebCore::setJSTestObjConditionalAttr1):
2987         (WebCore::setJSTestObjConditionalAttr2):
2988         (WebCore::setJSTestObjConditionalAttr3):
2989         (WebCore::setJSTestObjConditionalAttr4Constructor):
2990         (WebCore::setJSTestObjConditionalAttr5Constructor):
2991         (WebCore::setJSTestObjConditionalAttr6Constructor):
2992         (WebCore::setJSTestObjAnyAttribute):
2993         (WebCore::setJSTestObjMutablePoint):
2994         (WebCore::setJSTestObjImmutablePoint):
2995         (WebCore::setJSTestObjStrawberry):
2996         (WebCore::setJSTestObjStrictFloat):
2997         (WebCore::setJSTestObjId):
2998         (WebCore::setJSTestObjReplaceableAttribute):
2999         (WebCore::setJSTestObjNullableLongSettableAttribute):
3000         (WebCore::setJSTestObjNullableStringSettableAttribute):
3001         (WebCore::setJSTestObjNullableStringValue):
3002         (WebCore::setJSTestObjAttributeWithReservedEnumType):
3003         (WebCore::setJSTestObjPutForwardsAttribute):
3004         (WebCore::setJSTestObjPutForwardsNullableAttribute):
3005         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3006         (WebCore::setJSTestOverloadedConstructorsConstructor):
3007         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
3008         (WebCore::setJSTestOverrideBuiltinsConstructor):
3009         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
3010         (WebCore::setJSTestSerializedScriptValueInterfaceConstructor):
3011         (WebCore::setJSTestSerializedScriptValueInterfaceValue):
3012         (WebCore::setJSTestSerializedScriptValueInterfaceCachedValue):
3013         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3014         (WebCore::setJSTestTypedefsConstructor):
3015         (WebCore::setJSTestTypedefsUnsignedLongLongAttr):
3016         (WebCore::setJSTestTypedefsImmutableSerializedScriptValue):
3017         (WebCore::setJSTestTypedefsAttrWithGetterException):
3018         (WebCore::setJSTestTypedefsAttrWithSetterException):
3019         (WebCore::setJSTestTypedefsStringAttrWithGetterException):
3020         (WebCore::setJSTestTypedefsStringAttrWithSetterException):
3021         * bindings/scripts/test/JS/JSattribute.cpp:
3022         (WebCore::setJSattributeConstructor):
3023         * bindings/scripts/test/JS/JSreadonly.cpp:
3024         (WebCore::setJSreadonlyConstructor):
3025         * bridge/c/c_runtime.cpp:
3026         (JSC::Bindings::CField::setValueToInstance):
3027         * bridge/c/c_runtime.h:
3028         * bridge/jsc/BridgeJSC.h:
3029         (JSC::Bindings::Instance::put):
3030         * bridge/objc/objc_runtime.h:
3031         * bridge/objc/objc_runtime.mm:
3032         (JSC::Bindings::ObjcField::setValueToInstance):
3033         (JSC::Bindings::ObjcArray::setValueAt):
3034         (JSC::Bindings::ObjcFallbackObjectImp::put):
3035         * bridge/runtime_array.cpp:
3036         (JSC::RuntimeArray::put):
3037         (JSC::RuntimeArray::putByIndex):
3038         * bridge/runtime_array.h:
3039         * bridge/runtime_object.cpp:
3040         (JSC::Bindings::RuntimeObject::put):
3041         * bridge/runtime_object.h:
3042
3043 2016-03-11  David Kilzer  <ddkilzer@apple.com>
3044
3045         REGRESSION (r197956): WebContent process crashes on launch due to unrecognized selector
3046         <http://webkit.org/b/155356>
3047
3048         Reviewed by Alexey Proskuryakov.
3049
3050         * platform/mac/ScrollableAreaMac.mm:
3051         (WebCore::ScrollableArea::systemLanguageIsRTL): Add
3052         -respondsToSelector: check.
3053
3054 2016-03-11  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3055
3056         WTF should have a similar function as equalLettersIgnoringASCIICase to match beginning of strings
3057         https://bugs.webkit.org/show_bug.cgi?id=153419
3058
3059         Reviewed by Darin Adler.
3060
3061         Covered by added unint tests.
3062
3063         * Modules/fetch/FetchHeaders.cpp:
3064         (WebCore::isForbiddenHeaderName): Using startsWithLettersIgnoringASCIICase.
3065
3066 2016-03-11  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3067
3068         [Fetch API] Use DeferredWrapper directly in FetchBody promise handling
3069         https://bugs.webkit.org/show_bug.cgi?id=155291
3070
3071         Reviewed by Darin Adler.
3072
3073         Moved from typed DOMPromise to DeferredWrapper as there can only be one promise resolved.
3074         Started preparing the handling of blobs translation to other resolved types.
3075
3076         Fixed the case of empty body, in which case promises should resolve with empty objects (strings, buffers...) and not null.
3077
3078         Added Consumer structure to handle asynchronous resolution/rejection of promises.
3079         Added preliminary API to resolve promises based on data stored as a Blob.
3080         FetchBodyOwner will be responsible to do/stop blob loading.
3081
3082         Tests: imported/w3c/web-platform-tests/fetch/api/request/request-consume-empty.html
3083                imported/w3c/web-platform-tests/fetch/api/response/response-consume-empty.html
3084
3085         * Modules/fetch/FetchBody.cpp:
3086         (WebCore::FetchBody::processIfEmptyOrDisturbed): Fixed empty body case.
3087         (WebCore::FetchBody::arrayBuffer):
3088         (WebCore::FetchBody::blob):
3089         (WebCore::FetchBody::json):
3090         (WebCore::FetchBody::text):
3091         (WebCore::FetchBody::consume):
3092         (WebCore::FetchBody::consumeText):
3093         (WebCore::FetchBody::loadingType):
3094         (WebCore::FetchBody::consumeBlob):
3095         (WebCore::FetchBody::resolveAsJSON):
3096         (WebCore::FetchBody::loadingFailed):
3097         (WebCore::FetchBody::loadedAsBlob):
3098         * Modules/fetch/FetchBody.h:
3099         (WebCore::FetchBody::formData):
3100         (WebCore::FetchBody::Consumer::Consumer):
3101         * Modules/fetch/FetchBody.idl:
3102         * Modules/fetch/FetchBodyOwner.h:
3103         (WebCore::FetchBodyOwner::arrayBuffer):
3104         (WebCore::FetchBodyOwner::blob):
3105         (WebCore::FetchBodyOwner::formData):
3106         (WebCore::FetchBodyOwner::json):
3107         (WebCore::FetchBodyOwner::text):
3108         (WebCore::FetchBodyOwner::loadBlob):
3109
3110 2016-03-11  Yoav Weiss  <yoav@yoav.ws>
3111
3112         Avoid applying link tags with an invalid media attribute
3113         https://bugs.webkit.org/show_bug.cgi?id=143262
3114
3115         Reviewed by Brent Fulgham.
3116
3117         In current HTML spec, unlike HTML4, the UA must not apply <link> based resources
3118         when the media attribute does not match:
3119         https://html.spec.whatwg.org/multipage/semantics.html#attr-link-media
3120
3121         An invalid media attribute parsing creates a non-empty MediaQuerySet
3122         containing a single query with no expressions and no media type.
3123         (and with its m_ignored flag off)
3124
3125         In order to ignore such MediaQueries, I added an extra check that makes sure
3126         that the queries handled by MediaQueryEvaluator::eval have either expressions
3127         or a media type, and if not, they are ignored.
3128
3129         Test: fast/dom/HTMLLinkElement/link-stylesheet-invalid-media.html
3130
3131         * css/MediaQueryEvaluator.cpp:
3132         (WebCore::MediaQueryEvaluator::eval):
3133
3134 2016-03-11  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3135
3136         [CallWith=ScriptExecutionContext] should pass ScriptExecutionContext to the implementation by reference
3137         https://bugs.webkit.org/show_bug.cgi?id=155297
3138
3139         Reviewed by Darin Adler.
3140
3141         Changing the binding generator to pass ScriptExecutionContext by reference.
3142         Updating DOM classes accordingly.
3143
3144         Covered by existing tests.
3145
3146         * Modules/encryptedmedia/MediaKeySession.cpp:
3147         (WebCore::MediaKeySession::create):
3148         (WebCore::MediaKeySession::MediaKeySession):
3149         * Modules/encryptedmedia/MediaKeySession.h:
3150         * Modules/encryptedmedia/MediaKeys.cpp:
3151         (WebCore::MediaKeys::createSession):
3152         * Modules/encryptedmedia/MediaKeys.h:
3153         * Modules/fetch/FetchRequest.cpp:
3154         (WebCore::FetchRequest::clone):
3155         * Modules/fetch/FetchRequest.h:
3156         * Modules/fetch/FetchResponse.cpp:
3157         (WebCore::FetchResponse::error):
3158         (WebCore::FetchResponse::redirect):
3159         (WebCore::FetchResponse::clone):
3160         * Modules/fetch/FetchResponse.h:
3161         * Modules/indexeddb/IDBCursor.h:
3162         (WebCore::IDBCursor::continueFunction):
3163         * Modules/indexeddb/IDBFactory.h:
3164         * Modules/indexeddb/IDBIndex.h:
3165         * Modules/indexeddb/IDBKeyRange.cpp:
3166         (WebCore::IDBKeyRange::lowerValue):
3167         (WebCore::IDBKeyRange::upperValue):
3168         (WebCore::IDBKeyRange::only):
3169         (WebCore::IDBKeyRange::lowerBound):
3170         (WebCore::IDBKeyRange::upperBound):
3171         (WebCore::IDBKeyRange::bound):
3172         * Modules/indexeddb/IDBKeyRange.h:
3173         (WebCore::IDBKeyRange::lowerBound):
3174         (WebCore::IDBKeyRange::upperBound):
3175         (WebCore::IDBKeyRange::bound):
3176         * Modules/indexeddb/IDBObjectStore.h:
3177         * Modules/indexeddb/IDBOpenDBRequest.cpp:
3178         (WebCore::IDBOpenDBRequest::IDBOpenDBRequest):
3179         * Modules/indexeddb/IDBOpenDBRequest.h:
3180         * Modules/indexeddb/IDBRequest.cpp:
3181         (WebCore::IDBRequest::IDBRequest):
3182         * Modules/indexeddb/IDBRequest.h:
3183         * Modules/indexeddb/client/IDBCursorImpl.cpp:
3184         (WebCore::IDBClient::IDBCursor::continueFunction):
3185         (WebCore::IDBClient::IDBCursor::deleteFunction):
3186         * Modules/indexeddb/client/IDBCursorImpl.h:
3187         * Modules/indexeddb/client/IDBFactoryImpl.cpp:
3188         (WebCore::IDBClient::shouldThrowSecurityException):
3189         (WebCore::IDBClient::IDBFactory::getDatabaseNames):
3190         (WebCore::IDBClient::IDBFactory::open):
3191         (WebCore::IDBClient::IDBFactory::openInternal):
3192         (WebCore::IDBClient::IDBFactory::deleteDatabase):
3193         (WebCore::IDBClient::IDBFactory::cmp):
3194         * Modules/indexeddb/client/IDBFactoryImpl.h:
3195         * Modules/indexeddb/client/IDBIndexImpl.cpp:
3196         (WebCore::IDBClient::IDBIndex::IDBIndex):
3197         (WebCore::IDBClient::IDBIndex::openCursor):
3198         (WebCore::IDBClient::IDBIndex::count):
3199         (WebCore::IDBClient::IDBIndex::openKeyCursor):
3200         (WebCore::IDBClient::IDBIndex::get):
3201         (WebCore::IDBClient::IDBIndex::getKey):
3202         * Modules/indexeddb/client/IDBIndexImpl.h:
3203         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
3204         (WebCore::IDBClient::IDBObjectStore::create):
3205         (WebCore::IDBClient::IDBObjectStore::IDBObjectStore):
3206         (WebCore::IDBClient::IDBObjectStore::openCursor):
3207         (WebCore::IDBClient::IDBObjectStore::get):
3208         (WebCore::IDBClient::IDBObjectStore::deleteFunction):
3209         (WebCore::IDBClient::IDBObjectStore::doDelete):
3210         (WebCore::IDBClient::IDBObjectStore::modernDelete):
3211         (WebCore::IDBClient::IDBObjectStore::clear):
3212         (WebCore::IDBClient::IDBObjectStore::createIndex):
3213         (WebCore::IDBClient::IDBObjectStore::index):
3214         (WebCore::IDBClient::IDBObjectStore::count):
3215         * Modules/indexeddb/client/IDBObjectStoreImpl.h:
3216         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
3217         (WebCore::IDBClient::IDBOpenDBRequest::createDeleteRequest):
3218         (WebCore::IDBClient::IDBOpenDBRequest::createOpenRequest):
3219         (WebCore::IDBClient::IDBOpenDBRequest::IDBOpenDBRequest):
3220         * Modules/indexeddb/client/IDBOpenDBRequestImpl.h:
3221         * Modules/indexeddb/client/IDBRequestImpl.cpp:
3222         (WebCore::IDBClient::IDBRequest::IDBRequest):
3223         * Modules/indexeddb/client/IDBRequestImpl.h:
3224         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
3225         (WebCore::IDBClient::IDBTransaction::objectStore):
3226         (WebCore::IDBClient::IDBTransaction::createObjectStore):
3227         (WebCore::IDBClient::IDBTransaction::createIndex):
3228         * Modules/mediasource/DOMURLMediaSource.cpp:
3229         (WebCore::DOMURLMediaSource::createObjectURL):
3230         * Modules/mediasource/DOMURLMediaSource.h:
3231         * Modules/mediastream/DOMURLMediaStream.cpp:
3232         (WebCore::DOMURLMediaStream::createObjectURL):
3233         * Modules/mediastream/DOMURLMediaStream.h:
3234         * Modules/mediastream/HTMLMediaElementMediaStream.cpp:
3235         (WebCore::HTMLMediaElementMediaStream::setSrcObject):
3236         * Modules/mediastream/HTMLMediaElementMediaStream.h:
3237         * Modules/mediastream/HTMLMediaElementMediaStream.idl:
3238         * Modules/notifications/Notification.cpp:
3239         (WebCore::Notification::Notification):
3240         (WebCore::Notification::create):
3241         (WebCore::Notification::permission):
3242         (WebCore::Notification::requestPermission):
3243         * Modules/notifications/Notification.h:
3244         * Modules/notifications/NotificationCenter.cpp:
3245         (WebCore::NotificationCenter::createNotification):
3246         * Modules/notifications/NotificationClient.h:
3247         * Modules/quota/StorageInfo.cpp:
3248         (WebCore::StorageInfo::queryUsageAndQuota):
3249         (WebCore::StorageInfo::requestQuota):
3250         * Modules/quota/StorageInfo.h:
3251         * Modules/quota/StorageQuota.h:
3252         * bindings/js/JSIDBObjectStoreCustom.cpp:
3253         (WebCore::JSIDBObjectStore::createIndex):
3254         * bindings/scripts/CodeGeneratorJS.pm:
3255         (GenerateCallWith):
3256         * bindings/scripts/test/JS/JSTestInterface.cpp:
3257         (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
3258         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
3259         * bindings/scripts/test/JS/JSTestObj.cpp:
3260         (WebCore::jsTestObjWithScriptExecutionContextAttribute):
3261         (WebCore::jsTestObjWithScriptExecutionContextAttributeRaises):
3262         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttribute):
3263         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
3264         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
3265         (WebCore::setJSTestObjWithScriptExecutionContextAttribute):
3266         (WebCore::setJSTestObjWithScriptExecutionContextAttributeRaises):
3267         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute):
3268         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
3269         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
3270         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContext):
3271         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptState):
3272         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException):
3273         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces):
3274         * fileapi/FileReaderSync.cpp:
3275         (WebCore::FileReaderSync::readAsArrayBuffer):
3276         (WebCore::FileReaderSync::readAsBinaryString):
3277         (WebCore::FileReaderSync::readAsText):
3278         (WebCore::FileReaderSync::readAsDataURL):
3279         (WebCore::FileReaderSync::startLoading):
3280         * fileapi/FileReaderSync.h:
3281         (WebCore::FileReaderSync::readAsText):
3282         * html/DOMURL.cpp:
3283         (WebCore::DOMURL::createObjectURL):
3284         (WebCore::DOMURL::createPublicURL):
3285         (WebCore::DOMURL::revokeObjectURL):
3286         * html/DOMURL.h:
3287         * html/HTMLMediaElement.cpp:
3288         (WebCore::HTMLMediaElement::setSrcObject):
3289         * html/HTMLMediaElement.h:
3290         * inspector/InspectorIndexedDBAgent.cpp:
3291         (WebCore::InspectorIndexedDBAgent::requestDatabaseNames):
3292         * page/DOMWindow.h:
3293         * page/History.h:
3294         (WebCore::History::back):
3295         (WebCore::History::forward):
3296         (WebCore::History::go):
3297
3298 2016-03-10  Carlos Garcia Campos  <cgarcia@igalia.com>
3299
3300         [GTK] Fix rendering of slider input elements
3301         https://bugs.webkit.org/show_bug.cgi?id=155296
3302
3303         Reviewed by Michael Catanzaro.
3304
3305         Use the new gadgets for newer GTK+ and improve a bit the rendering
3306         for previous versions to better match GTK+.
3307
3308         * rendering/RenderThemeGtk.cpp:
3309         (WebCore::createStyleContext): Add ScaleContents and
3310         ScaleHighlight parts that are only used with GTK+ 3.19.
3311         (WebCore::RenderThemeGtk::paintSliderTrack): Use a smaller trough,
3312         centered in the given rectangle to better match GTK+. Also render
3313         the hightlight gadget with GTK+ 3.19.
3314         (WebCore::RenderThemeGtk::paintSliderThumb): Also create the style
3315         context for contents gadget.
3316         (WebCore::RenderThemeGtk::adjustSliderThumbSize): Take into
3317         account the slider border when calculating the slider thumb size.
3318
3319 2016-03-10  Carlos Garcia Campos  <cgarcia@igalia.com>
3320
3321         [GTK] Scrollbars are broken once again with current GTK+ master
3322         https://bugs.webkit.org/show_bug.cgi?id=155292
3323
3324         Reviewed by Michael Catanzaro.
3325
3326         Most of the trough theming properties have been moved to the
3327         scrollbar, and a new gadget "contents" has been added between the
3328         scrollbar and its children.
3329
3330         * platform/gtk/ScrollbarThemeGtk.cpp:
3331         (WebCore::ScrollbarThemeGtk::getOrCreateStyleContext): Add
3332         left/bottom style classes to ensure the scrollbars border is taken
3333         into account and rendered.
3334         (WebCore::ScrollbarThemeGtk::paintTrackBackground): Also create
3335         style context for contents gadget.
3336         (WebCore::ScrollbarThemeGtk::paintThumb): Ditto.
3337         (WebCore::ScrollbarThemeGtk::paintButton): Ditto.
3338         (WebCore::ScrollbarThemeGtk::scrollbarThickness): Take the
3339         scrollbar border into account.
3340         (WebCore::ScrollbarThemeGtk::buttonSize): Also create style
3341         context for contents gadget.
3342         (WebCore::ScrollbarThemeGtk::getStepperSpacing): Ditto.
3343         (WebCore::ScrollbarThemeGtk::minimumThumbLength): Ditto.
3344         (WebCore::ScrollbarThemeGtk::thumbFatness): Ditto.
3345         (WebCore::ScrollbarThemeGtk::getTroughBorder): Take the scrollbar
3346         border into account.
3347
3348 2016-03-10  David Kilzer  <ddkilzer@apple.com>
3349
3350         REGRESSION (r197983): Build fails due to missing inline method
3351
3352         Attempt to fix the following build failure:
3353
3354             Undefined symbols for architecture arm64:
3355               "JSC::GenericTypedArrayView<JSC::Uint8ClampedAdaptor>::createUninitialized(unsigned int)", referenced from:
3356                   WebCore::ImageBufferData::getData(WebCore::IntRect const&, WebCore::IntSize const&, bool, bool, float) const in ImageBufferDataCG.o
3357
3358         * platform/graphics/cg/ImageBufferDataCG.cpp: Include some
3359         headers to match FEGaussianBlur.cpp and FilterEffect.cpp.
3360
3361 2016-03-10  Tim Horton  <timothy_horton@apple.com>
3362
3363         Try to fix the iOS 9 build.
3364
3365         * editing/cocoa/DataDetection.mm:
3366         (WebCore::DataDetection::detectContentInRange):
3367         * platform/cocoa/DataDetectorsCoreSoftLink.h:
3368         * platform/cocoa/DataDetectorsCoreSoftLink.mm:
3369         * platform/spi/cocoa/DataDetectorsCoreSPI.h:
3370
3371 2016-03-10  David Kilzer  <ddkilzer@apple.com>
3372
3373         REGRESSION (r197976): Build failure due to missing DDOptionalSource.h header
3374
3375         Follow-up fix for:
3376             Expose additional WKDataDetectorTypes.
3377             <https://bugs.webkit.org/show_bug.cgi?id=155331>
3378
3379         * platform/spi/cocoa/DataDetectorsCoreSPI.h: Protect
3380         DDOptionalSource.h with version check.
3381
3382 2016-03-10  Alex Christensen  <achristensen@webkit.org>
3383
3384         Fix Windows build after r197986.
3385
3386         * accessibility/AccessibilityObject.h:
3387
3388 2016-03-10  Jeremy Jones  <jeremyj@apple.com>
3389
3390         Set AVURLAssetUsesNoPersistentCacheKey on AVAsset to match caching policy.
3391         https://bugs.webkit.org/show_bug.cgi?id=155117
3392         rdar://problem/6802240
3393
3394         Reviewed by Simon Fraser.
3395
3396         No new tests because no new functionality was added.
3397
3398         This will prevent persistent media caches when webkit is using in memory caching.
3399
3400         * html/HTMLMediaElement.cpp:
3401         (WebCore::HTMLMediaElement::mediaPlayerShouldUsePersistentCache): Added.
3402         * html/HTMLMediaElement.h: Declare mediaPlayerShouldUsePersistentCache().
3403         * page/ChromeClient.h: Declare mediaPlayerShouldUsePersistentCache().
3404         * platform/graphics/MediaPlayer.h:
3405         (WebCore::MediaPlayerClient::mediaPlayerShouldUsePersistentCache): Added.
3406         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3407         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Set property on AVAssetOptions.
3408
3409 2016-03-10  Jer Noble  <jer.noble@apple.com>
3410
3411         CRASH at WebCore::RenderView::updateVisibleViewportRect
3412         https://bugs.webkit.org/show_bug.cgi?id=155209
3413         <rdar://problem/23997530>
3414
3415         Reviewed by Simon Fraser.
3416
3417         Test: media/video-crash-invisible-autoplay-display-none.html
3418
3419         Between the time when the video element's renderer is created and destroyed, we may have unset the
3420         InvisibleAutoplayNotPermitted restriction. So rather than check for that restriction before
3421         unregistering for the "visible in viewport" notification, unregister only if the renderer
3422         was previously registered.
3423
3424         * html/HTMLMediaElement.cpp:
3425         (WebCore::HTMLMediaElement::willDetachRenderers):
3426
3427 2016-03-10  Zalan Bujtas  <zalan@apple.com>
3428