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